Bonjour,

j'ai quelques soucis dans l'utilisation de JNI, et les tutos que j'ai pu trouver pour l'instant ne m'ont pas paru très clairs.

Je fais le portage de bibliothèques écrites pour Linux, intégrées à Eclipse sous forme d'un plugin.

Je génère sans problème mes dll.
J'arrive à les charger (avec System.load), mais dès que j'essaye d'appeler une fonction de ma dll, tout foire.

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
23
24
25
26
!ENTRY org.eclipse.osgi 4 0 2011-05-18 11:08:28.867
!MESSAGE An error occurred while automatically activating bundle OTAWA (759).
!STACK 0
org.osgi.framework.BundleException: Exception in adtree.ADTREEPlugin.start() of bundle OTAWA.
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
[.......]
	at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
Caused by: java.lang.UnsatisfiedLinkError: ojawa.Otawa.idLABEL()J
	at ojawa.Otawa.idLABEL(Native Method)
	at ojawa.Otawa.<clinit>(Otawa.java:37)
	at adtree.ADTREEPlugin.start(ADTREEPlugin.java:234)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
	... 74 more
Root exception:
java.lang.UnsatisfiedLinkError: ojawa.Otawa.idLABEL()J
	at ojawa.Otawa.idLABEL(Native Method)
	at ojawa.Otawa.<clinit>(Otawa.java:37)
	at adtree.ADTREEPlugin.start(ADTREEPlugin.java:234)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
[.......]
	at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
Par exemple sur le code java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
String info = "OJAWA V" + ojawa.Otawa.version() + " (" + ojawa.Otawa.date() + ") found";
déclaré ainsi dans ojawa.Otawa (public abstract Class):
Code : Sélectionner tout - Visualiser dans une fenêtre à part
public static native String version();
Pourquoi ?