Exception in thread "main" java.lang.UnsatisfiedLinkError: no MyString in java.library.pathat java.lang.ClassLoader.loadLibrary(Unknown Source)at java.lang.Runtime.loadLibrary0(Unknown Source)at java.lang.System.loadLibrary(Unknown Source)at myPackage.MyString.<clinit>(myPackage/MyString.java:41)
package myPackage;class MyString { // Native Method(C) deklarieren public native void displayString(); // laden MyString.dll -Datei static { System.loadLibrary("MyString"); } public static void main(String[] args) { new MyString().displayString(); System.out.println("\n Aufruf aus Java"); }}
#include <jni.h>#include "myPackage_MyString.h"#include <stdio.h>JNIEXPORT void JNICALLJava_myPackage_MyString_displayString(JNIEnv *env, jobject obj) { printf("\n Aufruf aus C++ "); return;}