Hello Guest

Include everything in a jar

  • 4 Replies
  • 9989 Views
*

Offline @

  • *
  • 41
Include everything in a jar
« on: October 13, 2013, 11:05:58 »
I'm looking for ways to include in one jar the lwjgl lib along its natives, so wherever i include this jar, the project runs under any so (at least in desktops). The wiki only explains the process for one SO, should i deploy a new jar for every SO? if i recall properly, libGDX lets you deploy in every SO.

*

Offline kappa

  • *****
  • 1319
Re: Include everything in a jar
« Reply #1 on: October 13, 2013, 15:19:39 »
have a look at JarSplice, it allows you to include everything in a jar.

*

Offline @

  • *
  • 41
Re: Include everything in a jar
« Reply #2 on: October 13, 2013, 17:25:18 »
The tool comes in handy, but i'd rather know the process. Also, i prefer to set up eclipse (if possible) to save time, instead of using the tool everytime i want to deploy.

*

Offline @

  • *
  • 41
Re: Include everything in a jar
« Reply #3 on: October 15, 2013, 13:19:20 »
I found a nice solution based on this blog post. For those interested, code is here and is used like this:

Code: [Select]
NativeUtils.deleteOldDir();

final File parent = NativeUtils.createTempDir();

NativeUtils.loadLibraryFromJar(parent, "/natives/lwjgl.dll"); //For each library you need to add a new line like this.

System.setProperty("org.lwjgl.librarypath", parent.getAbsolutePath());