Results 1 to 4 of 4

Thread: using javac error

  1. #1
    laduch NNTP User

    Default using javac error

    I've downloaded and extracted rpm files from jdk-6u7-linux-i586-rpm.bin.
    All of the rpms are installed without error.
    The problem 1: no man manual about javac, but javac does exist
    The problem 2: all java script cannot be compiled, the error is:

    /usr/lib/gcc/i586-suse-linux/4.3/../../../crt1.o: In function `_start':
    (.text+0x18): undefined reference to `main'
    collect2: ld returned 1 exit status

  2. #2

    Default Re: using javac error

    Why not install the RPMs shipping with openSUSE?

  3. #3

    Default Re: using javac error

    Quote Originally Posted by jengelh View Post
    Why not install the RPMs shipping with openSUSE?

    1. There is no manual because you did not install the rpms from openSUSE, and therefore need to install documentation yourself.

    2. Assuming your code is correct, I would wonder why javac is pointing to some gcc library. Probably because your javac sym link is pointing to gnu's version of java, and you are importing packages incorrectly or your classpath is off.

    Fix: as stated, install the opensuse rpms. Otherwise, this is probably going to be more work than you want. (Updating symlinks, classpaths, etc.)

  4. #4
    whitebear NNTP User

    Default Re: using javac error

    Your system can handle multiple versions of jre and/or jdk. This is controlled by a linking mechanism, which is located under "/etc/alternatives/". In your situation, the rpms you installed did not properly configured themselves through this mec. and you're ended up using gcj, the Gnu Java Compiler, which would produce "a.out" instead of "xxx.class" and requires an argument "--main=<class name>" to indicate which class contains the main method you want os to invoke when "a.out" is executed.

    you may try the following command

    # update-alternatives --config javac

    to see if the rpms has registered themselves but not configured, under which case it would be pretty easy to use your new jdk. And there do exist a manual page for update-alternatives so you will have something to refer to if the command won't do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts