I am trying to find a way to put all my libraries and natives for Slick2D into one jar so I don't have to bring the lib and natives folder with my executable jar when I move it.
My project\dist folder currently contains lib, natives, and MyApp.jar. I want to have lib and natives inside MyApp.jar and still be accessible by the program.
Here is my source code for loading the natives (It works fine, it's just for clarification on what I'm trying to do).
try {
System.setProperty( "java.library.path", "natives");
Field fieldSysPath = ClassLoader.class.getDeclaredField( "sys_paths" );
fieldSysPath.setAccessible( true );
fieldSysPath.set( null, null );
} catch(NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
System.err.println("ERROR");
}
Thanks for your suggestions and help.