Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (290)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  OSXEnvironmentPlugin is not supported?  (Read 2302 times)
0 Members and 1 Guest are viewing this topic.
Offline CueMeX

Junior Newbie





« Posted 2009-04-29 21:18:33 »

Hello.

I'm trying to use my PS3 Controller with Java and jinput. I downloaded the files and ran the

java -Djava.library.path=. -cp jinput.jar:jinput-test.jar net.java.games.input.test.ControllerReadTest

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.OSXEnvironmentPlugin
java.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.

Can someone help me to get this run?

Thanks CueMex

Edit:
I have a Mac OS X System with an Intel processor
Offline endolf
« League of Dukes »

JGO Coder


Medals: 4
Projects: 1


Current project release date: sometime in 3003


« Reply #1 - Posted 2009-04-30 19:04:43 »

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.

HTH

Endolf

Offline endolf
« League of Dukes »

JGO Coder


Medals: 4
Projects: 1


Current project release date: sometime in 3003


« Reply #2 - Posted 2009-04-30 22:14:01 »

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

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?

HTH

Endolf

Games published by our own members! Check 'em out!
Play the free demo of Revenge of the Titans!
Offline CueMeX

Junior Newbie





« Reply #3 - Posted 2009-05-01 11:00:45 »

Thank you for the answer.

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.

With Windows it is no problem to set up the native lib.

More help?

Thx
CueMeX
Offline CueMeX

Junior Newbie





« Reply #4 - Posted 2009-05-02 12:47:32 »

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?

CueMeX
Offline CueMeX

Junior Newbie





« Reply #5 - Posted 2009-05-02 17:18:13 »

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.

CueMeX
Offline endolf
« League of Dukes »

JGO Coder


Medals: 4
Projects: 1


Current project release date: sometime in 3003


« Reply #6 - Posted 2009-05-03 19:53:04 »

Hi

I'm still a bit puzzled by this. I'm not a mac user normally, but have one for building JInput. It seems to work ok there. I'm glad you have a method that works for you.

Cheers

Endolf

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (66 views)
2013-05-17 21:29:12

alaslipknot (75 views)
2013-05-16 21:24:48

gouessej (106 views)
2013-05-16 00:53:38

gouessej (103 views)
2013-05-16 00:17:58

theagentd (113 views)
2013-05-15 15:01:13

theagentd (103 views)
2013-05-15 15:00:54

StreetDoggy (148 views)
2013-05-14 15:56:26

kutucuk (170 views)
2013-05-12 17:10:36

kutucuk (169 views)
2013-05-12 15:36:09

UnluckyDevil (178 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.081 seconds with 22 queries.