questions on gcj and javac compiled jar file
Tom Tromey
tromey@redhat.com
Tue Aug 23 14:08:00 GMT 2005
>>>>> "Jianming" == Jianming Ye <jye@bbn.com> writes:
Jianming> gcj --main=HelloWorld -I./test HelloWorld.java
Jianming> /tmp/ccIp2zpe.o(.text+0x1d): In function
Jianming> `HelloWorld::main(JArray<java::lang::String*>*)':
Jianming> : undefined reference to `test::Tester::class$'
If you compile this way, you have to think of building your java
program as if you were building a C or C++ program. So when you
compile a given class, you must also compile all the dependencies of
that class, and link them all together.
The traditional way to do this is to compile each .java file to a
separate .o, then link all the .o files together to make your
executable.
Tom
More information about the Java
mailing list