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 (407)
games submitted by our members
Games in WIP (293)
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 2849 times)
0 Members and 1 Guest are viewing this topic.
Offline alan502

Junior Newbie





« Posted 2010-12-14 04: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
« League of Dukes »

JGO Coder


Medals: 4
Projects: 1


Current project release date: sometime in 3003


« Reply #1 - Posted 2010-12-14 10: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 16: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!
Try the Free Demo of Droid Assault
Offline endolf
« League of Dukes »

JGO Coder


Medals: 4
Projects: 1


Current project release date: sometime in 3003


« Reply #3 - Posted 2010-12-19 17: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

JGO Ninja


Medals: 33
Projects: 1


TUER


« Reply #4 - Posted 2010-12-19 21: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 19: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

JGO Ninja


Medals: 33
Projects: 1


TUER


« Reply #6 - Posted 2010-12-24 22:24:11 »

Look at the list of packages in Synaptic.

Offline alan502

Junior Newbie





« Reply #7 - Posted 2010-12-27 15: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
« League of Dukes »

JGO Coder


Medals: 4
Projects: 1


Current project release date: sometime in 3003


« Reply #8 - Posted 2011-01-06 08: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.

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 (88 views)
2013-05-17 21:29:12

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

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

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

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

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

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

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

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

UnluckyDevil (191 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.092 seconds with 21 queries.