Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (542)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (606)
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  
  Jinput test wont run on linux 64bit  (Read 3874 times)
0 Members and 1 Guest are viewing this topic.
Offline alan502

Junior Newbie





« Posted 2010-12-14 03:38:45 »

Hi everybody Smiley I'm kind of new to Java, and have wrote some basic apps so I was thinking of trying jinput but i cannot even get the test run :S. I'm using kubuntu 64 bit and java version 1.6.0_18. Can you people please help me?

Quote
alan@alan-desktop:~/Downloads/Pkg/dist$ sudo java -Djava.library.path=. -cp jinput.jar:jinput-test.jar net.java.games.input.test.ControllerTextTest
[sudo] password for alan:
Controller Env = net.java.games.input.DefaultControllerEnvironment@55fdc96c
Dec 13, 2010 9:35:52 PM net.java.games.input.DefaultControllerEnvironment getControllers
INFO: Loading: net.java.games.input.LinuxEnvironmentPlugin
java.lang.ClassCastException: net.java.games.input.LinuxMouse cannot be cast to net.java.games.input.LinuxAbstractController
        at net.java.games.input.LinuxEnvironmentPlugin.enumerateControllers(LinuxEnvironmentPlugin.java:256)
        at net.java.games.input.LinuxEnvironmentPlugin.<init>(LinuxEnvironmentPlugin.java:112)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at java.lang.Class.newInstance0(Class.java:372)
        at java.lang.Class.newInstance(Class.java:325)
        at net.java.games.input.DefaultControllerEnvironment.getControllers(DefaultControllerEnvironment.java:160)
        at net.java.games.input.test.ControllerTextTest.<init>(ControllerTextTest.java:54)
        at net.java.games.input.test.ControllerTextTest.main(ControllerTextTest.java:86)
alan@alan-desktop:~/Downloads/Pkg/dist$ java -version
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8.1) (6b18-1.8.1-0ubuntu1)
OpenJDK 64-Bit Server VM (build 16.0-b13, mixed mode)
alan@alan-desktop:~/Downloads/Pkg/dist$ uname -r
2.6.32-24-generic
alan@alan-desktop:~/Downloads/Pkg/dist$
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #1 - Posted 2010-12-14 09:24:09 »

Hi

I'm not sure how you have managed that. It sounds like the classes were compiled with different compilers or something, LinuxMouse extends Mouse which extends AbstractController, so it can be cast.

Are you using a downloaded binary, or did you compile it yourself?, if you downloaded it, which binary did you get?

Thanks

Endolf

Offline alan502

Junior Newbie





« Reply #2 - Posted 2010-12-14 15:16:02 »

I downloaded this binaries: http://www.newdawnsoftware.com/resources/jinput/jinput_nightly_20100503.zip

at the document and files page: https://jinput.dev.java.net/servlets/ProjectDocumentList?folderID=0&expandFolder=0&folderID=0

Thanks

EDIT:

I forgot to copy the libraries to the proper folder and set the environment variable. I already downloaded Jutils and placed it both in the dist folder and the libraries folder. However, the tests continue to work improperly. ControllerReadTest Opens a blank window but ControllerTextTest and RumbleTest won't even run. Here's a copy of my command:

Quote
alan@alan-desktop:~/Downloads/Pkg/Jinput/dist$ sudo java -Djava.library.path=. -cp jinput.jar:jinput-test.jar net.java.games.input.test.ControllerTextTest
Controller Env = net.java.games.input.DefaultControllerEnvironment@24a20892
Dec 14, 2010 11:04:33 PM net.java.games.input.DefaultControllerEnvironment getControllers
INFO: Loading: net.java.games.input.LinuxEnvironmentPlugin
java.lang.ClassCastException: net.java.games.input.LinuxMouse cannot be cast to net.java.games.input.LinuxAbstractController
        at net.java.games.input.LinuxEnvironmentPlugin.enumerateControllers(LinuxEnvironmentPlugin.java:256)
        at net.java.games.input.LinuxEnvironmentPlugin.<init>(LinuxEnvironmentPlugin.java:112)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at java.lang.Class.newInstance0(Class.java:372)
        at java.lang.Class.newInstance(Class.java:325)
        at net.java.games.input.DefaultControllerEnvironment.getControllers(DefaultControllerEnvironment.java:160)
        at net.java.games.input.test.ControllerTextTest.<init>(ControllerTextTest.java:54)
        at net.java.games.input.test.ControllerTextTest.main(ControllerTextTest.java:86)
alan@alan-desktop:~/Downloads/Pkg/Jinput/dist$ sudo java -Djava.library.path=. -cp jinput.jar:jinput-test.jar net.java.games.input.test.RumbleTest
Dec 14, 2010 11:04:59 PM net.java.games.input.DefaultControllerEnvironment getControllers
INFO: Loading: net.java.games.input.LinuxEnvironmentPlugin
java.lang.ClassCastException: net.java.games.input.LinuxMouse cannot be cast to net.java.games.input.LinuxAbstractController
        at net.java.games.input.LinuxEnvironmentPlugin.enumerateControllers(LinuxEnvironmentPlugin.java:256)
        at net.java.games.input.LinuxEnvironmentPlugin.<init>(LinuxEnvironmentPlugin.java:112)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at java.lang.Class.newInstance0(Class.java:372)
        at java.lang.Class.newInstance(Class.java:325)
        at net.java.games.input.DefaultControllerEnvironment.getControllers(DefaultControllerEnvironment.java:160)
        at net.java.games.input.test.RumbleTest.<init>(RumbleTest.java:21)
        at net.java.games.input.test.RumbleTest.main(RumbleTest.java:69)
alan@alan-desktop:~/Downloads/Pkg/Jinput/dist$ ls
jinput-dx8_64.dll  jinput-dx8.dll  jinput.jar  jinput-raw_64.dll  jinput-raw.dll  jinput-test.jar  jinput-wintab.dll  jutils.jar  libjinput-linux64.so  libjinput-linux.so  libjinput-osx.jnilib
alan@alan-desktop:~/Downloads/Pkg/Jinput/dist$ ls $LD_LIBRARY_PATH
jutil.jar  jutils.jar  libjinput-linux64.so  libjinput-linux.so  libjinput-osx.jnilib
alan@alan-desktop:~/Downloads/Pkg/Jinput/dist$

My joypad is already pluggin in, btw Tongue And Linux recognizes it correctly, it works alright.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #3 - Posted 2010-12-19 16:18:26 »

On sun java 1.6.0_13 it works fine, I downloaded that build to test it. I have no idea if this is something that openjdk has made fail. Can you try a sun 1.6 jdk?, if it works on that then we know something has changed with openjdk that needs looking at, if it fails there to then it is something in your environment making it fail.

I *think* debian or ubuntu has started to include jinput as one of it's installable packages, maybe that is conflicting somewhere?

Endolf

Offline gouessej
« Reply #4 - Posted 2010-12-19 20:27:36 »

I *think* debian or ubuntu has started to include jinput as one of it's installable packages, maybe that is conflicting somewhere?
It is highly probable, they do the same for JOGL.

Offline alan502

Junior Newbie





« Reply #5 - Posted 2010-12-24 18:51:02 »

It's something in my environment. I installed sun's jdk and still, doesn't run. It gives me pretty much the same error:

alan@alan-desktop:~/Downloads/Pkg/Jinput/dist$ sudo /usr/lib/jvm/java-6-sun/jre/bin/java -Djava.library.path=. -cp jinput.jar:jinput-test.jar net.java.games.input.test.ControllerTextTest
Controller Env = net.java.games.input.DefaultControllerEnvironment@7ca83b8a
Dec 24, 2010 12:45:23 PM net.java.games.input.DefaultControllerEnvironment getControllers
INFO: Loading: net.java.games.input.LinuxEnvironmentPlugin
java.lang.ClassCastException: net.java.games.input.LinuxMouse cannot be cast to net.java.games.input.LinuxAbstractController
        at net.java.games.input.LinuxEnvironmentPlugin.enumerateControllers(LinuxEnvironmentPlugin.java:256)
        at net.java.games.input.LinuxEnvironmentPlugin.<init>(LinuxEnvironmentPlugin.java:112)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at net.java.games.input.DefaultControllerEnvironment.getControllers(DefaultControllerEnvironment.java:160)
        at net.java.games.input.test.ControllerTextTest.<init>(ControllerTextTest.java:54)
        at net.java.games.input.test.ControllerTextTest.main(ControllerTextTest.java:86)
alan@alan-desktop:~/Downloads/Pkg/Jinput/dist$ sudo /usr/lib/jvm/java-6-sun/jre/bin/java -Djava.library.path=. -cp jinput.jar:jinput-test.jar net.java.games.input.test.ControllerReadTest
Dec 24, 2010 12:47:35 PM net.java.games.input.DefaultControllerEnvironment getControllers
INFO: Loading: net.java.games.input.LinuxEnvironmentPlugin
java.lang.ClassCastException: net.java.games.input.LinuxMouse cannot be cast to net.java.games.input.LinuxAbstractController
        at net.java.games.input.LinuxEnvironmentPlugin.enumerateControllers(LinuxEnvironmentPlugin.java:256)
        at net.java.games.input.LinuxEnvironmentPlugin.<init>(LinuxEnvironmentPlugin.java:112)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at net.java.games.input.DefaultControllerEnvironment.getControllers(DefaultControllerEnvironment.java:160)
        at net.java.games.input.test.ControllerReadTest.<init>(ControllerReadTest.java:252)
        at net.java.games.input.test.ControllerReadTest.main(ControllerReadTest.java:301)


I don't have a clue of what it might be though Huh Is there something else I should check? BTW, I looked for jinput and it is in the repositories but only for 10.10, I'm using 10.04
Offline gouessej
« Reply #6 - Posted 2010-12-24 21:24:11 »

Look at the list of packages in Synaptic.

Offline alan502

Junior Newbie





« Reply #7 - Posted 2010-12-27 14:26:08 »

Look at the list of packages in Synaptic.

I have already checked, It's the first thing I did after I visited the Jinput page! But as I said, there isn't a Jinput build for Karmic, just for Maveric.
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #8 - Posted 2011-01-06 07:43:12 »

It works on my linux 64 bit system, so it *must* be environmental, but I have no idea what, it doesn't make sense unless there are some over versions of the class files somewhere.

Endolf

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.

Elsealabs (20 views)
2014-12-28 10:39:27

CopyableCougar4 (21 views)
2014-12-28 02:10:29

BurntPizza (25 views)
2014-12-27 22:38:51

Mr.CodeIt (15 views)
2014-12-27 04:03:04

TheDudeFromCI (20 views)
2014-12-27 02:14:49

Mr.CodeIt (26 views)
2014-12-23 03:34:11

rwatson462 (59 views)
2014-12-15 09:26:44

Mr.CodeIt (48 views)
2014-12-14 19:50:38

BurntPizza (98 views)
2014-12-09 22:41:13

BurntPizza (116 views)
2014-12-08 04:46:31
How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

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
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!