UnsatisfiedLinkError with Linux

Hi,

I downloaded JInput from https://jinput.dev.java.net/
I created a test class :

import net.java.games.input.Controller;
import net.java.games.input.ControllerEnvironment;

public class TestControllers {
	public static void main(String[] args) {
		ControllerEnvironment ce = ControllerEnvironment.getDefaultEnvironment();
		Controller[] controllers = ce.getControllers();
		for (Controller controller : controllers) {
			System.out.println("-> " + controller.getType());
			System.out.println("\t" + controller);
		}
	}
}

It works well with Windows XP, but not with Linux Ubuntu 8.10 (kernel 2.6.27-11-generic) !
I have an exception with Eclipse :

[quote]Loading: net.java.games.input.LinuxEnvironmentPlugin
Failed to load 64 bit library: no jinput-linux64 in java.library.path
java.lang.UnsatisfiedLinkError: no jinput-linux in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at net.java.games.input.LinuxEnvironmentPlugin$1.run(LinuxEnvironmentPlugin.java:65)
at java.security.AccessController.doPrivileged(Native Method)
at net.java.games.input.LinuxEnvironmentPlugin.loadLibrary(LinuxEnvironmentPlugin.java:58)
at net.java.games.input.LinuxEnvironmentPlugin.(LinuxEnvironmentPlugin.java:92)
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 TestControllers.main(TestControllers.java:10)
net.java.games.input.LinuxEnvironmentPlugin is not supported
[/quote]
Can you help me, please ?

Are you on a 64 bit ubuntu?

I don’t know how old that build was, does the latest nightly from http://www.newdawnsoftware.com/resources/jinput/jinput_nightly_.zip do the same thing?

Cheers

Endolf

P.S. if you’re using xinput-evdev (the default in 8.10) you might have to play with some of the X settings. They broke a load of stuff, see this thread

Thanks for your answer.

[quote]Are you on a 64 bit ubuntu?
[/quote]
No !

I have put “libjinput-linux.so” at the root of my project, and found a solution with a VM argument :

[quote]-Djava.library.path="./"
[/quote]
It works fine :slight_smile:

But the keyboard is not found :frowning: just my gamepad. I have the message :

[quote]Loading: net.java.games.input.LinuxEnvironmentPlugin
Failed to open device (/dev/input/event3): Failed to open device /dev/input/event3 (13)
Failed to open device (/dev/input/event6): Failed to open device /dev/input/event6 (13)
Failed to open device (/dev/input/event5): Failed to open device /dev/input/event5 (13)
Failed to open device (/dev/input/event4): Failed to open device /dev/input/event4 (13)
Failed to open device (/dev/input/event2): Failed to open device /dev/input/event2 (13)
Failed to open device (/dev/input/event1): Failed to open device /dev/input/event1 (13)
Failed to open device (/dev/input/event0): Failed to open device /dev/input/event0 (13)
Linux plugin claims to have found 1 controllers
-> Stick
Saitek P990 Dual Analog Pad
[/quote]
And the buttons and paddle are without effects ! :frowning: (with ubuntu, not with Windows)

I am going to try the latest nightly…

Only rumble effects are supported currently.

Failed to open device implies that the user you are running as doesn’t have read permissions to /dev/input/event* nodes. No effects might also be caused by having no write permissions to the appropriate device node.

HTH

Endolf

Maybe you have the ddl in the right place, but Linux doesn’t use DLL so you need that other ext there too.

Well. I put user permissions on files “event*” and the Keyboard works perfectly, haleluya :smiley:
But i have still some problems with gamepads. I would create a new topic.
Thank you very much for your advices :slight_smile: