This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Error when trying to run java program with gij


>>>>> "Per-Olof" == Per-Olof Wallin <perwal-6@student.luth.se> writes:

>>> Exception in thread "main" java.lang.ClassNotFoundException: hello

Per-Olof> Today I've also tried compiling the program into object
Per-Olof> files using: >>gcj hello.java and >>gcj hello.class, but
Per-Olof> neither of the commands work. I get the message:

>>> Undefined                       first referenced
>>> symbol                             in file
>>> main                               

This is a FAQ.  You have to use the `--main' option, like this:

    gcj -o hello --main=hello hello.java

>>> /users/pwallin/gcc/3.0.4/lib/gcc-lib/sparc-sun-solaris2.8/3.0.4/crt1.o

You didn't tell us you were on Sparc.  The bytecode interpreter
doesn't work on Sparc; no one has ported it.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]