Hello,
I am a Java beginner and facing problem at JNI level. I have to load a C++ library through my JNI layer and the problem is my JNI (/JAVA) code is
same for 32bit and 64bit JVM. 2 different processes will use this code and 1 will run under 32JVM and another under 64JVM.
Hence I have to load 32bit C++ library in one process instance and 64bith C++ library in another.
I found this way to determine the JVM bit version during run time,
static {
String jvmModel = System.getProperty("sun.arch.data.model");
if(jvmModel.equals("64"))
{
System.loadLibrary("library64");
}
else
{
System.loadLibrary("library32");
}
}
but my question is, is this portable? as it appears to me it will run only in SUN JVM. If not portable what is the portable way?
Best REgards,
Ananth