Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (711)
Games in Android Showcase (213)
games submitted by our members
Games in WIP (785)
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  
  Problem with JAR + dxinput.dll  (Read 2099 times)
0 Members and 1 Guest are viewing this topic.
Offline wrAthchild

Senior Newbie

« Posted 2008-07-13 14:10:53 »


I was hoping for some input on a very annoying problem of mine. Feeling is it must have a simple solution... I did some searching this forum before posting, didn't find any tip, so...:

I've made a simple game which uses JInput, more specifically I use a gamepad to play it. Everythings works as expected in my IDE (NetBeans) so no problem here. However, I'm trying to bundle everything in an executable JAR (in the unlikely event that someone actually wants to try it Smiley). This works almost as expected; code, images and sound are all OK, but the most important piece is missing, the gamepad functionality...

Both the plugins and native files are included in JAR (lib/native, lib/plugin, lib/runtime). Im using a class loader ( which handles the JAR creation. The docs concerning this loader states that all files, including native ones, can be placed at any location within the JAR; the loader will find them. But somehow the gamepad functionality is not there when running the JAR hmmm.

I have tried to manually set the java library path (absolute), to point at dxinput.dll, as follows:

try {
    System.setProperty("java.library.path", "c:/MinAppFolder/MinApp/");
    // also tried System.loadLibrary("dxinput.dll") here...
catch(UnsatisfiedLinkError e) {

The above code being placed first in the program main-method. It's of course not ideal, but I did this just to test if I could get it to work at all...
No luck with this option either :/ (I'm never getting UnsatisfiedLinkError though)

Have any of you experienced this problem aswell? I would really appreciate some help with this, feels like I've tried all options. What am I doing wrong?

/ Anders
Offline wrAthchild

Senior Newbie

« Reply #1 - Posted 2008-07-13 16:36:15 »

Been looking around some more in this forum and it seems like many of you actually got this to work; being able to deploy through JWS etc, suggests that you either never had this problem, or have overcome it.

Looking forward to hearing your solutions Smiley Want to get this up and many hours..

/ Anders
Offline wrAthchild

Senior Newbie

« Reply #2 - Posted 2008-07-13 21:50:20 »

Ok, it seems like a solution has arrived Smiley

The best part is that the native files are actually located and loaded from within the JAR (which I didn't think was easily doable). Not been setting a single java.library.path. I have yet to work out all the details, but I successfully managed to interact with my app (executed by JAR) through a gamepad.

First of all I have been using an old version of JInput (just used the same files I found in a tutorial ("jinputTutorialOne" I think). That version included only one dll file, dxinput.dll. I got the latest via link in "Getting started..." Smiley. Found out that the Axis class (of older version) was removed so I had to modify (in the process of doing this Smiley) some methods in my app to make it work. Great relief to see the gamepad responding at last, when running my app-jar!

/ Anders
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

numerical (271 views)
2017-02-21 07:32:16

numerical (269 views)
2017-02-21 07:31:46

theagentd (381 views)
2017-02-18 13:42:33

theagentd (380 views)
2017-02-18 13:35:16

h.pernpeintner (1547 views)
2017-01-24 22:39:11

h.pernpeintner (1534 views)
2017-01-24 22:38:32

Galdo (2099 views)
2017-01-12 13:44:09

Archive (2099 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2636 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2346 views)
2016-12-15 21:50:57
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 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‑
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!