JNI and package ..
Hello,
I'm developing an API in Java, which make call to C function via native methods.
My program works fine without pakcage.
Since I've added some "Package" command to my Java code, I've got some "java.lang.UnsatisfiedLinkError" :
Here is the output:
starting..
Library path = /usr/local/j2sdk1.4.0_01/jre/lib/i386/client:/usr/local/j2sdk1.4.0_01/jre/lib/i386:/usr/local/j2sdk1.4.0_01/jre/../lib/i386:/usr/lib
Exception in thread "main" java.lang.UnsatisfiedLinkError: cryptozen_rsa_mod_expat com.zencod.cryptozen.zenrsa.cryptozen_rsa_mod_exp(Native Method)
at com.zencod.cryptozen.zenrsa.cryptozen_rsa_mod_exp(zenrsa.java:236)
at com.zencod.cryptozen.ZEN_RSA.Crypt(ZEN_RSA.java:1540)
at com.zencod.cryptozen.ZEN_RSA.cryptBloc_doMode(ZEN_RSA.java:999)
at com.zencod.cryptozen.ZEN_RSA.engineUpdate(ZEN_RSA.java:457)
at com.zencod.cryptozen.ZEN_RSA.engineDoFinal(ZEN_RSA.java:699)
at test_cipher.main(test_cipher.java:37)
I don't undestand why I've got this error:
- my path is OK ! my library is in /usr/lib
- after adding "Package", I've recompile my source code, and redo a "javah -jni .." to have a new ".h"
- I've modified my C code
- I've installed the new library in /usr/lib
And it still not works !!
My questions are:
1) For my package, do I've to use "javah -jni com.zencod.cryptozen.zenrsa" or "javah -jni com/zencod/cryptozen/zenrsa" from the source's root ? result is not the same !
2) Do I've to use javah in the subdirectories of my package, or at the root directory of my package ? result is not the same too !
Could you help me?
* Fabien *

