Wednesday, December 30, 2009

JNI_CreateJavaVM failed with "Failed to find VM - aborting" in Linux for IBM JDK1.5

I was trying to use IBM JDK 1.5 JNI in Linux.
I've added the libjvm.so path i.e. "ibm-jre/jre/bin/classic" to the LD_LIBRARY_PATH.
when I launched the code I've got "Failed to find VM - aborting" message after running the JNI_CreateJavaVM.
after investigating this for a while I found that the JVM lib is loading other libs that are located in "ibm-jre/jre/bin" path.
So adding both "ibm-jre/jre/bin/classic" and "ibm-jre/jre/bin" to the LD_LIBRARY_PATH resolved the issue and the JVM was initate Okay.

BTW, When I tried to use IBM JDK1.6 in Linux with only "ibm-jre/jre/bin/classic" in the LD_LIBRARY_PATH then the JVM was launched Okay.