I don't know what to do. I have jdk1.4. When I try to compile test.c I've got this: test.o(.text+0x19): undefined reference to `JNI_GetDefaultJavaVMInitArgs' test.o(.text+0x5a): undefined reference to `JNI_CreateJavaVM' I've specified all header files but don't know what else gcc wants p.s.: -ljava -ljvm couldn't be found in OS. What wrong ?
Hi Andrey, I am not sure whether this is correct. The jni.h file can be located in the <JAVA_HOME>/include directory, have you included this path in your build file. Probably the compiler is not able to locate this include file. But I guess that if the compiler cannot locate an include file, the message will be something else. This is just a guess. Hope this helps
Thanks,<p>Vijay<p>The Hand that gives, Gathers.
posted 17 years ago
Thanks for answer! But the_trouble is somewere else : gcc -I/usr/local/jdk/include -I/usr/local/j2sdk1.4.0/include/linux -L/usr/local/jdk/jre/lib test.c test.c: In function `main': test.c:34: warning: passing arg 2 of `JNI_CreateJavaVM' from incompatible pointer type /tmp/ccALNCFh.o: In function `main': /tmp/ccALNCFh.o(.text+0x19): undefined reference to `JNI_GetDefaultJavaVMInitArgs' /tmp/ccALNCFh.o(.text+0x5a): undefined reference to `JNI_CreateJavaVM' p.s.: jni.h resides in .../jdk/include. [ February 20, 2003: Message edited by: Andrey Safonov ]