Re: Under Linux, Call java from C++



Yes. I changed the path into:

rakta:~/GAQ$ export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/jvm/java-1.4.2-sun-1.4.2_05/jre/lib/i386/server:/usr/lib/jvm/java-1.4.2-sun-1.4.2_05/jre/lib/i386

Then compile it, and the error kept the same:

invokeLinux.cpp: In function `int main()':
invokeLinux.cpp:24: error: `JNI_VERSION_1_4_2_05' undeclared (first use
this
function)
invokeLinux.cpp:24: error: (Each undeclared identifier is reported only
once
for each function it appears in.)

If I remove the line "vm_args.version = JNI_VERSION_1_4_2_05",
I can compile it, but the final result kept the same:
"Can't create Java VM"

Sorry for my questions.

.



Relevant Pages