Bonjour,
Le code suivant fonctionne tr�s bien (chargement de dll pour JNI):
(la dll jni_madll me permet uniquement d'utiliser madll avec jni sans modifier les sources)
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 public class TestJNI1 { public native String digit2Number(int number); static{ System.loadLibrary("lib/madll"); System.loadLibrary("lib/jni_madll"); } public static void main(String[] args){ TestJNI1 t = new TestJNI1(); int test = 25654; System.out.println("Le nombre " + test + " s'écrit : \n" + t.digit2Number(test)); } }
Maintenant, j'aimerais ne pas mettre la chemin complet de la dll et y acc�der grace � la variable java.library.path. Je modifie donc un peu mon code :
La trace indique que mon r�pertoire qui contient mes librairies est bien dans java.library.path mais j'ai le message d'erreur suivant :
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7 static{ System.setProperty("java.library.path",{REPERTOIRE D INSTALL} + "\\lib;" + System.getProperty("java.library.path")); System.out.println(System.getProperty("java.library.path")); System.loadLibrary("madll"); System.loadLibrary("jni_madll"); }
A mon avis, je modifie mal la variable java.library.path car si je mets mes librairies dans un r�pertoire d�j� contenu dans cette variable (ex. bin de java home) alors l�, le syst�me les trouvent...java.lang.UnsatisfiedLinkError: no digit2Number in java.library.path
Partager