3

I am currently writing a game using the Slick2D library, which uses LWJGL. My LWJGL version is 2.9.3. I am using Netbeans 8.

I tried adding sounds to my game, for example a music track on the main menu. Problem is, I get this exception when I run my game, despite the game still compiling and running normally except for the sound of course:

Sat Mar 21 01:23:57 EDT 2015 ERROR:Could not locate OpenAL library.
org.lwjgl.LWJGLException: Could not locate OpenAL library.
    at org.lwjgl.openal.AL.create(AL.java:156)  at org.lwjgl.openal.AL.create(AL.java:156)
    at org.lwjgl.openal.AL.create(AL.java:102)
    at org.lwjgl.openal.AL.create(AL.java:206)
    at org.newdawn.slick.openal.SoundStore$1.run(SoundStore.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.newdawn.slick.openal.SoundStore.init(SoundStore.java:292)
    at org.newdawn.slick.Music.<init>(Music.java:156)
    at org.newdawn.slick.Music.<init>(Music.java:75)
    at view.MainMenu.init(MainMenu.java:58)

I didn't include the rest of the error as it only states where the error happens in my game code.

The code I use to play the sound is with the Music class of Slick2D:

theme = new Music("MainMenu.ogg");
            theme.play();

I've been searching far and wide, tried multiple solutions, but still, it didn't fix my problem. I think it might be related to the way my libraries are implemented into the project. Any help would be greatly appreciated.

Also, before suggesting, I do have ibxm, jorbis and jogg libraries installed, as well as the needed natives for OpenAL in a dedicated folder for natives. Here is the command line I use in the run properties of the project:

-Djava.library.path="./native/windows/"
jww
  • 83,594
  • 69
  • 338
  • 732
Fire Yoshi
  • 41
  • 4

0 Answers0