test application. And it worked fine. Now I use the same source code in my eclipse project but it doesn't work.

I get the message:Loading: net.java.games.input.OSXEnvironmentPluginjava.lang.UnsatisfiedLinkError: /Users/.../lib/libjinput-osx.jnilib: net.java.games.input.OSXEnvironmentPlugin is not supported at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1739) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1030) at net.java.games.input.OSXEnvironmentPlugin$1.run(OSXEnvironmentPlugin.java:78) at java.security.AccessController.doPrivileged(Native Method) at net.java.games.input.OSXEnvironmentPlugin.loadLibrary(OSXEnvironmentPlugin.java:70) at net.java.games.input.OSXEnvironmentPlugin.<clinit>(OSXEnvironmentPlugin.java:110) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at net.java.games.input.DefaultControllerEnvironment.getControllers(DefaultControllerEnvironment.java:156) at sailworld.RobSailer.main(RobSailer.java:42)

The jar file as well as the native libraries are included in the class path and the libjinput-osx.jnilib file is at the position, where the jvm cannot find it.

This is just saying that your project isn't set up correctly and it can't find the native. Either set the natives in the properties of the jinput.jar, or pass that -Djava.library.path flag as a runtime VM arguement in the run settings.

Editing your post after I respond doesn't help me figure out what you changed

You say the jar is on the classpath. That's ok, the binary being on the classpath is irrelevant as natives can only be loaded from java.library.path or lib/ext in the jre if I remember correctly. The location that it's failing to load from is /lib/ in the root of your file system. Is that really where you put the native file?

But i tried the Djava.library.path flag, than the jvm searches the native lib in the given path but cannot find it anyway. I tried pathes without spaces like: /User/bla/Desktop insted of /User/bla/Documents/Projekt - RobSailer/ but it still isn't working. I had also set up the native directory for the jar and it still isn't working.

Now I tried to put the libjinput-osx.jnilib in the path /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Libraries/ where all the other native libraries are. I removed the the information in the eclipse project where to find the native lib. When i then started the application. i got the following message:

java.lang.UnsatisfiedLinkError: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Libraries/libjinput-osx.jnilib: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1723) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1030) at net.java.games.input.OSXEnvironmentPlugin$1.run(OSXEnvironmentPlugin.java:78) at java.security.AccessController.doPrivileged(Native Method) at net.java.games.input.OSXEnvironmentPlugin.loadLibrary(OSXEnvironmentPlugin.java:70) at net.java.games.input.OSXEnvironmentPlugin.<clinit>(OSXEnvironmentPlugin.java:110) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at net.java.games.input.DefaultControllerEnvironment.getControllers(DefaultControllerEnvironment.java:156) at sailworld.util.SailInputPad.<init>(SailInputPad.java:20) at sailworld.RobSailer.main(RobSailer.java:36)

I think that means, that the native lib was found. Are there other dependencies?

Hm.Now I put the jar and the native lib in the directories of my javavm.When i export my application to a jar file and start it it works.But i have to export it, i cannot start the application out of eclipse.

Thanks for the posts. I can live with this solution.If anyone knows why there is a problem with eclipse, i am thankful. But it works now.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org