2

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.

kgrad
  • 4,672
  • 7
  • 36
  • 57

3 Answers3

2

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
  • 2,228
  • 18
  • 22
1

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

-1

Did you try using passing the d32 jvm param while building the jar.

Here is how you do it

http://www.technimi.com/index.php?do=/group/java/forum/building-an-exe-using-launch4j-for-32-bit-jvm/

javangelo
  • 27
  • 2