lwjgl3: Unable to dynamically load libopenal32.so

I am trying to use OpenAL under 32-bit Linux but there’s an exception loading libopenal32.so. Using the same PC but 64-bit Linux works. I am encountering this problem on all three devices I’ve tested this on. I’ve tried both OpenJDK and HotSpot (Java 8). I’m not sure if the warning regarding the stack guard is relevant. OpenGL is working.

[LWJGL] Version 3.0.0a | Linux | i386
OpenJDK Server VM warning: You have loaded library /mnt/usb/Development/bms/lwjgl3/native/liblwjgl32.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
[LWJGL] MemoryUtil MemoryAccessor: MemoryAccessorUnsafe
Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.lwjgl.openal.ALDevice.create(ALDevice.java:71)
    at org.lwjgl.openal.ALContext.create(ALContext.java:90)
    at bms.sound.OpenAlSoundEngine.initialize(OpenAlSoundEngine.java:29)
    at experiment.HelloLwjgl.loop(HelloLwjgl.java:116)
    at experiment.HelloLwjgl.run(HelloLwjgl.java:50)
    at bms.Bms.main(Bms.java:7)
Caused by: java.lang.RuntimeException: Failed to dynamically load library: lwjgl3/native/libopenal32.so
    at org.lwjgl.system.linux.LinuxLibrary.<init>(LinuxLibrary.java:29)
    at org.lwjgl.system.APIUtil.apiCreateLibrary(APIUtil.java:56)
    at org.lwjgl.LWJGLUtil$2.load(LWJGLUtil.java:402)
    at org.lwjgl.LWJGLUtil$2.load(LWJGLUtil.java:399)
    at org.lwjgl.LWJGLUtil.loadLibrary(LWJGLUtil.java:410)
    at org.lwjgl.LWJGLUtil.loadLibraryNative(LWJGLUtil.java:370)
    at org.lwjgl.openal.ALC.create(ALC.java:55)
    at org.lwjgl.openal.ALC.create(ALC.java:48)
    at org.lwjgl.openal.ALC.<clinit>(ALC.java:27)
    ... 6 more

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 20 (8 by maintainers)

Most upvoted comments

I think the point of Spasi’s question was not to know whether you extracted the files, but where they reside now. In some SIP-secured folder or something.

This could be related to SIP. Where did you extract the LWJGL binaries?

Just like you added -XstartOnFirstThread to the “VM arguments” field in your run configuration, you also can add -Djava.library.path=/the/path/to/your/natives in that edit field. Either separate it from the other argument via a space or via newline.

Yes, -Djava.library.path should be set to the native folder.

Alternatively, you could add the natives to a jar and add that jar to the classpath; LWJGL will auto-extract it to a temp folder and use the natives automatically. (no -Djava.library.path is required in this case)

Are you setting -Djava.library.path to the correct directory?

Looks like there’s a problem with the library path(s), dlopen cannot even find the shared libraries. How is your application launched?

I cannot reproduce it. Could you run with -Dorg.lwjgl.util.Debug=true and post the output here? Also, please make sure you use the latest nightly build.