S
stixwix
Hi,
I have a java program using JNI that works fine when in the default
(none) package.
If I have a directory called test:
The java code sits in this dir and I compile it from here.
I then run javah which creates the header file in this dir.
I then ggc the c code from here.
- it's all fine.
But in the real world this should be in a package so lets say the java
code goes in a a sub-dir of test called child.
The java code sits in this child dir and I compile it from here.
I change dir to the parent test dir.
I then run javah -jni which creates the header file in this dir (the
header file is now called child_xxx).
I then ggc the c code from here (after editing for the new header file
name).
- I get java.lang.UnsatisfiedLinkError: at the line number that i
call the native method in my java code.
The shared object remains exported as it was for the first working
attempt and I load the lib in the same way in the java code.
What gives...?
Thanks,
Andy
I have a java program using JNI that works fine when in the default
(none) package.
If I have a directory called test:
The java code sits in this dir and I compile it from here.
I then run javah which creates the header file in this dir.
I then ggc the c code from here.
- it's all fine.
But in the real world this should be in a package so lets say the java
code goes in a a sub-dir of test called child.
The java code sits in this child dir and I compile it from here.
I change dir to the parent test dir.
I then run javah -jni which creates the header file in this dir (the
header file is now called child_xxx).
I then ggc the c code from here (after editing for the new header file
name).
- I get java.lang.UnsatisfiedLinkError: at the line number that i
call the native method in my java code.
The shared object remains exported as it was for the first working
attempt and I load the lib in the same way in the java code.
What gives...?
Thanks,
Andy