Thursday, July 17, 2008

JNI issues on linux

Problem #1: when compiling JNI component on a linux machine, it was missing tons of type definitions from jni.h. It appears libgcj-devel-version needs to be installed as the jni.h in it has the native datatype definitions.

Problem #2: if you see an error message such as the following when executing JNI components:
wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
Chances are that your jni shared library .so was compiled to be 64bit but your JDK/JVM is 32-bit! just use 64-bit java to run it instead

No comments: