Okay, so I know I need to set the path to the native files. I can do this in Eclipse, by going to the VM arguments and using -Djava.library.path=, but when I export, it says that the VM arguments aren't kept after exporting, but it can be set in the console while running it. I am running Mac OS X. How do I set that using Terminal?
It should be exactly the same, just provide -Djava.library.path="your_path" to java when you run it:
I just wrote a nifty way to solve this problem, without needing to define the library beforehand. Which is more useful when you actually deploy your game. Basically it goes like this:
This needs to happen first thing. So at the beginning of your
Then you have your
Use those to return an enum that defines your OS and architecture, i.e.
Then you load your natives that are packaged in your .jar file (step 2 from above). Depending on the OS and architecture you'll load certain files from the LWJGL native binaries. For example
Finally, tell Java about this new library resource (Step 3 from above):