JInput on Windows - IllegalName

When I try to run my code on Windows (with the aproriate dxinput plugin) one thing is that the components are axes now (???), so I’ll have to modify my code. I don’t think I use it correctly, because that shouldn’t be. Another, much complicated thing is, that I get a serious error at runtime. Look at that:


initializing world...Scanning jar: jinput.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/AbstractComponent.class
Examining file : net/java/games/input/AbstractController.class
Examining file : net/java/games/input/Component$Identifier$Axis.class
Examining file : net/java/games/input/Component$Identifier$Button.class
Examining file : net/java/games/input/Component$Identifier$Key.classException in thread "main" java.lang.NoClassDefFoundError: IllegalName: net/java/games/input/DirectInputEnvironmentPlugin
	at java.lang.ClassLoader.preDefineClass(Unknown Source)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.access$100(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at net.java.games.util.plugins.Plugins.processJar(Plugins.java:112)
	at net.java.games.util.plugins.Plugins.scanPlugins(Plugins.java:85)
	at net.java.games.util.plugins.Plugins.<init>(Plugins.java:73)
	at net.java.games.input.DefaultControllerEnvironment.scanControllersAt(DefaultControllerEnvironment.java:174)
	at net.java.games.input.DefaultControllerEnvironment.scanControllers(DefaultControllerEnvironment.java:164)
	at net.java.games.input.DefaultControllerEnvironment.access$000(DefaultControllerEnvironment.java:57)
	at net.java.games.input.DefaultControllerEnvironment$1.run(DefaultControllerEnvironment.java:108)
	at java.security.AccessController.doPrivileged(Native Method)
	at net.java.games.input.DefaultControllerEnvironment.getControllers(DefaultControllerEnvironment.java:106)
	at world.controller.CsInput.getInputDevices(CsInput.java:267)
	at world.controller.CsInput.<init>(CsInput.java:286)
	at world.CsWorld.<init>(CsWorld.java:77)
	at demos.XithConcept.<init>(XithConcept.java:154)
	at demos.XithConcept.main(XithConcept.java:222)

Examining file : net/java/games/input/Component$Identifier.class
Examining file : net/java/games/input/Component$POV.class
Examining file : net/java/games/input/Component.class
Examining file : net/java/games/input/Controller$PortType.class
Examining file : net/java/games/input/Controller$Type.class
Examining file : net/java/games/input/Controller.class
Examining file : net/java/games/input/ControllerEnvironment.class
Examining file : net/java/games/input/ControllerEvent.class
Examining file : net/java/games/input/ControllerListener.class
Examining file : net/java/games/input/DefaultControllerEnvironment$1.class
Examining file : net/java/games/input/DefaultControllerEnvironment.class
Examining file : net/java/games/input/Keyboard$Key.class
Examining file : net/java/games/input/Keyboard.class
Examining file : net/java/games/input/Mouse$Ball.class
Examining file : net/java/games/input/Mouse$Button.class
Examining file : net/java/games/input/Mouse$Buttons.class
Examining file : net/java/games/input/Mouse.class
Examining file : net/java/games/input/PluginClassLoader$1.class
Examining file : net/java/games/input/PluginClassLoader$JarFileFilter.class
Examining file : net/java/games/input/PluginClassLoader.class
Examining file : net/java/games/input/Rumbler.class
Examining file : net/java/games/input/StandardKeyboard.class
Examining file : net/java/games/input/Version.class
Examining file : net/java/games/input/test/
Examining file : net/java/games/input/test/AnalogAxisPanel.class
Examining file : net/java/games/input/test/AxisPanel.class
Examining file : net/java/games/input/test/ControllerReadTest$1.class
Examining file : net/java/games/input/test/ControllerReadTest.class
Examining file : net/java/games/input/test/ControllerTextTest.class
Examining file : net/java/games/input/test/ControllerWindow.class
Examining file : net/java/games/input/test/DigitalAxisPanel.class
Examining file : net/java/games/input/test/DigitalHatPanel.class
Examining file : net/java/games/input/test/RumbleTest.class
Examining file : net/java/games/input/DirectInputAxis.class
Examining file : net/java/games/input/DirectInputDevice.class
Examining file : net/java/games/input/DirectInputEnvironmentPlugin.class
Found candidate class: net/java/games/input/DirectInputEnvironmentPlugin.class

Any idea how to fix that?

Qudus

Hi

I’m sure that the old ‘plugins don’t work on 1.5’ problem. Did you compile your own utils+jinput, or did you download the binaries from somewhere?, if so, which ones?

Endolf

P.S. give http://www.newdawnsoftware.com/resources/jinput/webstart/jinput2.jnlp a try, if it works, then it’s your jinput files that are broken. Then we can sort it out at least

I just downloaded the binaries. I tried this one and this one. The same error in both cases. Except that in the newer one, there where Axes instead of Components.

I wasn’t able to startThe jnlp for some reason:


Beim Starten/Ausführen der Anwendung ist ein Fehler aufgetreten.

Titel: JInput webstart demo
Hersteller: New Dawn Software
Kategorie: Download-Fehler

Ressource konnte nicht geladen werden: http://www.newdawnsoftware.com/resources/jinput/webstart/jinput.jnlp

Ah, by the way: thanks for your friendly help.

Hmm

I’m assuming that means that the download failed no?

well it works from here, I have no idea how the connection didn’t work. The files are there. I viewed them in a browser, and ran it on linux and windows to check. I’m a bit worried that you said that with those files, one had Axes and one had Components was a major worry, as they both are the new Components styles.

Endolf

Maybe I just bound the wrong libs. I took the jinput.jar (win-plugin), the controller.jar and the jutils.jar (in that order) into my classpath and the jinput-dxplugin.dll’s folder as java.library.path. I got no compile time error when I left controller.jar and jutils.jar away. Am I doing this right?

On Linux I get good results when I use in the order mentioned first (of cause with the linux plugin).

Ah, by the way. Is it correct that you have to hold the plugin jar and native in a ‘controller’ folder in the pwd? This would annoy one who’s trying to release a program for both linux and win.

Now when I’m at home again, I’m able to start your webstart example. I can see all my three buttons interact with the labels on the frame. So this looks good.

Ok I just tried it on my windows box. There was a list of some keys but no mouse buttons. some of the keys reacted. So it seems that the mouse wasn’t found. There was not any java error.

Edit: OK. Tried it out. It is not necessary to put them into the ‘controller’ folder. Seems like I got TheBohemian wrong from his tutorial and it was just a suggestion.

Got it running on my Windows box!

Is there a minimum DirectX version to use with the DirectX plugin? I tried it at work with … hmm… the one coming with XP, I think. Maybe there should be a better error message. Something like ‘there is no directx usable on your system’.

Is there a plugin for windows without directx?

Qudus

Hi

Glad it’s working, I’m confused about the mouse issue, we just wrap what directx gives us, there should be 2 windows for each mouse, one is the buttons, and the other is the axis.

Windows plugin required dx 7 or 8, I forget which, either way, default XP has it. No idea why it didn’t work. If you could paste the full output from the window, we might be able to spot it.

Endolf

Look at my first post in this thread. I believe, it is the full output. Or what else do you need?

Now I’ll go to sleep. Tomorrow (in about 8 hours), I will give you more, if you need.

So far, thanks for all your help,

Qudus

Hi

I meant the mouse issues. A class not found is due to classpath issues and controller plugin location issues. If you get the binaries from jinput.dev.java.net under files section, then you automatically get the right plugin in a place it can be accessed. I was hoping we could sort the mouse issue out for you.

Endolf

It seems to be a problem on my windows pc at work. Another win pc (identical to mine) doesn’t have that problem. Since I have no sound with my pc I think I’ll have a general directx problem or so.

As I reported earlier, my XP box at home is able to make use of JInput.

So it doesn’t seem to be a problem with jinput. But the error message is irritating anyway. I’ll try to sort out the problem with my pc and will report to you if I found a solution.

It’s running!

I deleted all the libraries and natives of xith, jinput and so on and placed them cleanly and newly to the right positions. Now it’s working. No idea, what I made wrong.

Thank you very much for your help.

Qudus

Excelent. The new dist system is much simpler as you just have one jar and one native lib, so it’s really easy to distribute, the webstart demo is far easier to put together now for example :slight_smile:

Endolf