Include everything in a jar

Started by @, October 13, 2013, 11:05:58

Previous topic - Next topic


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.


have a look at JarSplice, it allows you to include everything in a jar.


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.


I found a nice solution based on this blog post. For those interested, code is here and is used like this:

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());