Error when trying to run java program with gij
Tom Tromey
tromey@redhat.com
Fri Apr 19 11:06:00 GMT 2002
>>>>> "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
More information about the Java
mailing list