tags:

views:

554

answers:

2

Hey all, I am trying to wrap my jar as an exe using launch4j. However I am using the lwjgl library and having trouble linking the native dll's. My directory structure is as follows:

I have a top directory which contains the following path: top/lib/lwjgl/native/win32 where my lwjgl dll's are contained.

There is also a dist directory that contains my jar top/dist/myapp.jar

I can run my program from the commandline within the dist dir using the following command:

java -ea -Djava.library.path=../lib/lwjgl/native/win32 -jar app.jar

and it works perfectly. Now I defined my launch4j xml file to reside within the dist dir with a commandline option of -ea -Djava.library.path=../lib/lwjgl/native/win32

However, when I try to run the exe file I get an unsatisfied link error. (Meaning it cannot find my lwjgl dlls).

I have tried defining this in multiple different ways. I defined the changedir as ../ and used -ea -Djava.library.path=lib/lwjgl/native/win32 as well as attempting to move my exe to the top directory and using /dist/app.jar and the lib path and nothing seems to be working.

Has anyone had a problem similar to this before? How can I get launch4j to recognize my dll path?

thanks.

+2  A: 

On the launch4j forums this was asked in relation to SWT which requires dll's. See this or this or search for how others dealt with SWT issues.

Allen
+1  A: 

I bypass this problem by copying all native (.ddl) files to the "top" dir next to the game exe.

Greets Tobse