Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
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  
  linux problems  (Read 2403 times)
0 Members and 1 Guest are viewing this topic.
Offline gregof

Junior Duke




in code we trust


« Posted 2003-09-30 10:23:56 »

Hi All
I have been trying to get jinput working under linux, I run redhat 9.0 with a 2.6.0-test6 kernel with evdev compiled in and joydev as a module. The problem is that I get the errormessage "Failed to init native jinput", this occurs when i do
ControllerEnvironment environment = ControllerEnvironment.
       getDefaultEnvironment();
Controller[] controllers = environment.getControllers();
The output in the console is:

Scanning jar: linux.jar
Examining file : META-INF/
Examining file : META-INF/MANIFEST.MF
Examining file : net/
Examining file : net/java/
Examining file : net/java/games/
Examining file : net/java/games/input/
Examining file : net/java/games/input/LinuxDevice$LinuxHat.class
Examining file : net/java/games/input/LinuxDevice$ButtonID.class
Examining file : net/java/games/input/LinuxDevice$1.class
Examining file : net/java/games/input/LinuxDevice.class
Examining file : net/java/games/input/LinuxAxis.class
Examining file : net/java/games/input/LinuxEnvironmentPlugin.class
Found candidate class: net/java/games/input/LinuxEnvironmentPlugin.class
Adding class to plugins:net.java.games.input.LinuxEnvironmentPlugin
Examining file : net/java/games/input/LinuxKeyboard$KeyID.class
Examining file : net/java/games/input/LinuxKeyboard.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseBall.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseButtons.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseButton.class
Examining file : net/java/games/input/LinuxMouse.class
Examining file : net/java/games/input/LinuxNativeTypesMap.class
Examining file : net/java/games/input/NativeDefinitions.class
Failed to init native jinput
and I dont get any controllers back Sad
Am I doing something wrong or are there some known issue with jinput?

Thanks in advance //
                               Gregof

Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #1 - Posted 2003-09-30 15:20:24 »

Eeep

My debug messages in the native side arn't too helpfull it seems Smiley. Are you able to build jinput from CVS? or are you using the pre-built code?, I ask because there are a couple of places it throws that message, but I'm not sure which place, I want to update the messages to be unique so I can further debug this.

One thing that pops off the top of my head for ideas though, check that all of your event? and js? device nodes in /dev have read and write permissions for the user you are trying to run as.

Cheers

Endolf (The one to blame when the linux plugin breaks)

Offline gregof

Junior Duke




in code we trust


« Reply #2 - Posted 2003-09-30 16:44:21 »

Hi, thanks for the suggestions.
Iam runnig the pre-built version of jinput. Sadly I dont have access to test anything until tomorrow morning :-( but then I will check the permissions for the devices. If that doesn't help I will try to build the cvs-version for further testing.

// Gregof
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #3 - Posted 2003-09-30 21:23:30 »

You should be able to grab the nightly build and be within 24 hours of up to date with the CVS.


Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #4 - Posted 2003-10-01 05:32:55 »

Hi
 I can't update the messages in cvs till i have access to my source and a linux box to test on (saturday), I was just going to provide the changes as text on here and see if they would play nice, I guess this will have to go on hold till monday, when the nightly builds should have caught up. Unless the permissions check fixes it. I'll update the messages on saturday anyway as it's something that should be done.

Cheers

Endolf

Offline gregof

Junior Duke




in code we trust


« Reply #5 - Posted 2003-10-01 08:13:23 »

Hi again
I checked the permissions on /dev/input/event* and I gave all users rwx-permission, then i got:


Scanning jar: linux.jar
Examining file : META-INF/
Examining file : META-INF/MANIFEST.MF
Examining file : net/
Examining file : net/java/
Examining file : net/java/games/
Examining file : net/java/games/input/
Examining file : net/java/games/input/LinuxDevice$LinuxHat.class
Examining file : net/java/games/input/LinuxDevice$ButtonID.class
Examining file : net/java/games/input/LinuxDevice$1.class
Examining file : net/java/games/input/LinuxDevice.class
Examining file : net/java/games/input/LinuxAxis.class
Examining file : net/java/games/input/LinuxEnvironmentPlugin.class
Found candidate class: net/java/games/input/LinuxEnvironmentPlugin.class
Adding class to plugins:net.java.games.input.LinuxEnvironmentPlugin
Examining file : net/java/games/input/LinuxKeyboard$KeyID.class
Examining file : net/java/games/input/LinuxKeyboard.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseBall.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseButtons.class
Examining file : net/java/games/input/LinuxMouse$LinuxMouseButton.class
Examining file : net/java/games/input/LinuxMouse.class
Examining file : net/java/games/input/LinuxNativeTypesMap.class
Examining file : net/java/games/input/NativeDefinitions.class
Error opening device /dev/input/event10
: No such device
Error reading device /dev/input/event10
: Bad file descriptor
Error reading device /dev/input/event10
: Bad file descriptor
Error reading device /dev/input/event10
: Bad file descriptor
Error opening device /dev/input/event11
: No such device
Error reading device /dev/input/event11
: Bad file descriptor
Error reading device /dev/input/event11
: Bad file descriptor
Error reading device /dev/input/event11
: Bad file descriptor
Error opening device /dev/input/event12
: No such device

... And so on on all event*, and then it says:  "Failed to init native jinput" again.

I must be doing something wrong Embarrassed, are there some good documents that describes how to set up the evdev and jinput on linux? I have searched for it, but I havent found any.
any ideas?

thanks //
            Gregof

Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #6 - Posted 2003-10-01 10:02:03 »

Hi
 OK, problem 1 solved at least Smiley, The reason for those messages is because you have event device files that point to devices that aren't, or never were, plugged in. I have no idea who/what created them, on my system they are created and deleted as devices are connected and disconnected. I've had a look at the code and I can work round it, the code for joysticks to work round this error is already in there, just need to copy it to event devices, i'll add it to the list for saturday Smiley

Cheers

Endolf

Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #7 - Posted 2003-10-04 10:56:45 »

Hi
 Just commited some changes to the linux plugin, hopefully show up in the nightly build some time soon, it should ignore devices it can't open, but still fail if it can open the device (ie, it's a valid device) but not read it, this will mean you still get errors if your devices arn't read enabled, but won't get errors if there are files hanging around for devices that aint plugged in.

Cheers

Endolf

Offline TheBohemian

Junior Duke




Java will rule them all!


« Reply #8 - Posted 2004-03-05 13:01:10 »

I cannot use the jinput linux plugins with JDK1.5.0 (beta) due to the following exception:
Examining file : net/java/games/input/LinuxEnvironmentPlugin.class
Found candidate class: net/java/games/input/LinuxEnvironmentPlugin.class
Exception in thread "main" java.lang.NoClassDefFoundError: IllegalName: net/java/games/input/LinuxEnvironmentPlugin
       at java.lang.ClassLoader.preDefineClass(ClassLoader.java:459)

With 1.4.2.03 and same classpath, file layout whatever it works without problems.

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline Jeff

JGO Coder




Got any cats?


« Reply #9 - Posted 2004-03-06 03:23:42 »

Id ask you to PLEASE bug report it against 1.5 ASAP.

At a guess it looks like some genius thought net.java should be restricted to bootclasspath (eg sun only) packages (can you say 'not clear on the concept' ?)

That or the class loader is just broken.


Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline TheBohemian

Junior Duke




Java will rule them all!


« Reply #10 - Posted 2004-03-07 13:18:12 »

OK, I filed this as a bug.

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline Jeff

JGO Coder




Got any cats?


« Reply #11 - Posted 2004-03-08 02:22:55 »

ty

lets see what they say...  if it still seems NAFU I'll actively chase it inside.

JK

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline Jeff

JGO Coder




Got any cats?


« Reply #12 - Posted 2004-03-15 22:40:39 »

ALright.

They made a change to ClassLoader that broke old code.

I updated the Plugins class  so it should work now with 1.5

Give it a shot and let me know if there are still problems.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline TheBohemian

Junior Duke




Java will rule them all!


« Reply #13 - Posted 2004-04-15 19:44:47 »

Sorry but better late than never.

It works!

This is a good day for our game Smiley

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (67 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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
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!