[Solved] Bullet doesn't find native library when running game in headless mode

I have a server that I’m trying to shift from jbullet to native bullet. When I run the server with native bullet, I get a java.lang.UnsatisfiedLinkError exception, which generally points to the fact that it can’t find the .dll file. After some testing I figured out that if I removed the headless mode from the server, it ran just fine and could find the .dll file.

So, why would headless mode stop native bullet from finding its native library?

This is actually an area of the code I’m not familiar with… but a guess is that the code JME uses to extract the native DLLs (of which bullet’s is one) doesn’t run in headless.

I’m not sure of the exact call but you might be able to run the extraction code manually… like there’s a method but I don’t know what it is.

Thanks, I found the extraction code after searching a bit on the github. Turns out that the LwjglContext as a method called loadNatives which as the following lines in it:

if (NativeLibraryLoader.isUsingNativeBullet()) {
    NativeLibraryLoader.loadNativeLibrary("bulletjme", true);

Using that successfully loaded the native library for bullet.