This is how I do it:
-export runnable .jar file with libraries inside the jar
-put native files near the jar file and load them from inside the .jar file.
public class Natives {
public static void load() {
String system = System.getProperty("os.name");
String path = null;
path = new File("nat").getAbsolutePath();
if(path == null) {
System.out.println("Couldn't load natives!");
return;
}
path += "\\";
if (system.contains("Windows")) {
System.setProperty("org.lwjgl.librarypath", path + "Windows");
}
else if (system.contains("Mac")) {
System.setProperty("org.lwjgl.librarypath", path + "Mac");
}
else if (system.contains("Linux")) {
System.setProperty("org.lwjgl.librarypath", path + "Linux");
}
}
}
EDIT:
So basically just to make something clear.
You need to have your natives setup like this
My Folder (Folder)
- myjarfile.jar (.jar File)
- nat (Folder)
- Windows (Folder)
- your windows native files here (File)
- Mac (Folder)
- your mac native files here (File)
- Linux (Folder)
- your linux native files here (File)