J'ai une bibliothèque appelée HelloWorld.so et un HelloWorld.java de programme avec ce contenu:Pourquoi est-ce que je reçois ce UnsatisfiedLinkError avec du code natif?
class HelloWorld {
private native void print();
public static void main(String[] args) {
new HelloWorld().print();
}
static {
System.loadLibrary("HelloWorld");
}
}
Maintenant, quand je tente de lancer HelloWorld.java je reçois cette erreur:
$ /usr/java1.4/bin/java HelloWorld Exception in thread "main" java.lang.UnsatisfiedLinkError: no HelloWorld in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1491) at java.lang.Runtime.loadLibrary0(Runtime.java:788) at java.lang.System.loadLibrary(System.java:834) at HelloWorld.<clinit>(HelloWorld.java:7)
Tous les conseils ?
Si votre utilisation de Linux (Ubuntu terminal), alors s'il vous plaît jeter un oeil sur http://saurabhsharma123k.blogspot.in/2017 /07/java-jni-and-cc-from-command-line.html –