Bonjour à tous,
A première vue, c'est un problème récurant, mais je n'ai pas trouvé la solution dans les dernies posts.
je tente de charger une une librairie qui se situe dans un dossier qui m'est propre. j'ai donc codé ceci pour pouvoir la chargée:
la création de l'objet est fait comme ceci
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
16
17
18 public class CodeGenerator { public CodeGenerator(MainWindows Windows,String CodeWorkerFolder) { try { System.setProperty("java.library.path", CodeWorkerFolder + ";" + System.getProperty("java.library.path")); System.out.println("java.library.path = " + System.getProperty("java.library.path")); System.loadLibrary("JNICodeWorker"); } catch (Exception exception) { System.out.println("java.library.path = " + CodeWorkerFolder); System.out.println("Unable to load the library: '" + exception.toString() + "'"); } } public void GenerateFile(String SourceFolder,String WorkingFolder ) { ... }
Mais voila, cela ne marche pas et j'ai le message suivant lorsque je crée un object du type CodeGenerator :
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
16
17
18
19
20
21
22 public class ExecuteCodeWorker extends AbstractAction { private MainWindows Windows; public ExecuteCodeWorker(MainWindows Windows) { // Create the action object super("Generate files"); putValue(Action.SHORT_DESCRIPTION, "Creates file which specific configuration"); this.Windows = Windows; } public void actionPerformed(ActionEvent e) { CodeGenerator Motor = new CodeGenerator(Windows, Windows.dataBase.ExtractGeneralInformation( "GeneralConfiguration","CODE_WORKER_FOLDER")); Motor.GenerateDriver(Windows.dataBase.ExtractGeneralInformation( "GeneralConfiguration","BASE_FOLDER"), Windows.dataBase.ExtractGeneralInformation( "GeneralConfiguration","WORKING_FOLDER")); } }
java.library.path = E:/user/tools/CodeWorker;C:\Borland\JBuilder2005\jdk1.5\bin; ....
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no JNICodeWorker in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
Pourtant, mon java.library.path est correct et contient bien le repertoire contenant la librairie. Si je déplace ma librairie dans n'importe quel répertoire défini dans le java.library.path, cela fonctionne correctement.
C'est un peu comme si le java.library.path avait bien été modifié, mais pas pris en compte !
Si quelqu'un à une idée, Cela m'aiderais bien.
merci
[ Modéré par Viena ]
Ajout tag résolu : Pensez au tag [Résolu], c'est rapide et ça évite de passer du temps à ouvrir des posts qui ont déjà une réponse.
Les Règles du Forum
Partager