I am using CodeWarrior (CW) 8.3 on OS X.3.9 to create a [C++] jnilib
which my Java program loads with loadLibrary.
The jnilib is being found, and the JNI function is being called, but I
get a bus error anytime I access the JNIEnv "env" parameter such as in:
jclass clazz = env->GetObjectClass(myJStringParameter); // bus error
anytime accessing env
The Java program is compiled with CW 8.3 inside the same project.
The OS X project was ****ted from a CW 6 project that works on Mac OS
9.1.
Running the program from within CodeWarrior or launching the .jar from
the Finder (using the Console utility to view the output) makes no
difference.
Compiling the Java program with rt.jar 1.3 or 1.4 makes no difference.
I reproduced the problem in 2 other similarly-coded projects, in
addition to the attached example.
On another machine, recompiling the jnilib with CW 9 resulted in the
same bus error, so if you solve for CW 9 the solution will most likely
work for CW 8.3.
I need a CW 8.3 solution (as opposed to a different IDE or version of
CW).
A sample trivial CW 8.3 Java/C++ project that demonstrates the problem
is attached.
--
Chuck King
Brainworks Software