I am writing a Java program on Suse Linux 11 using JavaSE-1.6 and I am having a problem using javac.
I follow the tutorial on
http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniexamp.html
and still wrote the following:
package com.ctest; class CTest {
When I run javac CTest.java, I get an error:
/usr/lib/gcc/i586-suse-linux/4.3/../../../crt1.o: in function '_start': /usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/i386/elf/start.S:115: undefined reference to 'main' /tmp/cc97kcJu.o:(.data+0x28) undefined reference to 'hidden alias for int com::ctest::CTest::testCall()' /tmp/cc97kcJu.o:(.data+0x74) undefined reference to 'hidden alias for int com::ctest::CTest::testCall()' collect2: ld returned 1 exit status
I suspect it uses gcc, not the java version of javac, but I'm not sure.
What ideas might come up?
I tried using the "--main =" option mentioned here:
http://gcc.gnu.org/java/faq.html#4_1
but instead of an error, before I just get:
/tmp/ccwfugWq.o:(.data+0x28) undefined reference to 'hidden alias for int com::ctest::CTest::testCall()' /tmp/ccwfugWq.o:(.data+0x74) undefined reference to 'hidden alias for int com::ctest::CTest::testCall()' collect2: ld returned 1 exit status
source share