LibGDX / LWJGL Could not locate OpenAL library

Hey all,

I’ve been using libGDX to deploy as an applet and webstart (and to Android, but that doesn’t matter to my question).

On Java 6, everything works fine as both an applet and webstart.

However, after upgrading to Java 7, I get an Exception when I try to run it as an applet- either from the webpage, or from eclipse directly. The Exception stack trace is as follows:

org.lwjgl.LWJGLException: Could not locate OpenAL library.
at org.lwjgl.openal.AL.create(AL.java:151)
at org.lwjgl.openal.AL.create(AL.java:102)
at org.lwjgl.openal.AL.create(AL.java:201)
at com.badlogic.gdx.backends.openal.OpenALAudio.(OpenALAudio.java:69)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.(LwjglApplication.java:78)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.(LwjglApplication.java:67)
at com.badlogic.gdx.backends.lwjgl.LwjglApplet$LwjglAppletApplication.(LwjglApplet.java:34)
at com.badlogic.gdx.backends.lwjgl.LwjglApplet$2.addNotify(LwjglApplet.java:72)
at java.awt.Container.addNotify(Container.java:2769)
at java.awt.Panel.addNotify(Panel.java:87)
at java.awt.Container.addImpl(Container.java:1114)
at java.awt.Container.add(Container.java:431)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:769)
at sun.applet.AppletPanel.run(AppletPanel.java:379)
at java.lang.Thread.run(Thread.java:722)

The latest applet that this affects is here: http://staticvoidgames.com/play/?game=SumoBounce&view=applet

And the webstart version of that same exact code, which works fine on both Java 6 and 7, is here: http://staticvoidgames.com/play/?game=SumoBounce&view=webstart

I’ve tested this on various computers, as well as had other people test it. Running the applet works fine on Java 6, but throws the above Exception after upgrading the same machine to Java 7.

Is this a known issue, or a symptom of me doing something dumb? I can provide code, but I’m not doing anything too crazy, plus that Exception doesn’t mention any of my code.

As always, I appreciate any help you can give me.

What libraries are you using from libgdx?
I was having same error.
I removed one unnecessary lib and it stopped.
Also, Netbeans is known to give that stupid error.
Or instead of using lwjgl, use jwjgl, something like that, is another listener :smiley:

Thanks for the fast reply. All I’m doing is using the libGDX setup ui to create the project, so I’m only using whatever libraries it sets up. The error happens upon initialization, so it doesn’t even seem to get to my code.

What library did you remove? All I have are the LWJGL libraries, which I’m pretty sure I need. I’m unfamiliar with JWJGL, but I want to stick with LWJGL if at all possible.

I’m only guessing, but I think maybe Java 7 has stricter security that’s disallowing something that LWJGL needs, but like I said, that’s really only a shot in the dark.

I’m using eclipse, not netbeans.

You can use the backend based on JogAmp (JOGL 2 + JOAL 1.1.3) but I’m not sure it will solve your problem.

Maybe try with the nightly build of LWJGL 2.9. Check that you request all permissions in applets with JNLP and if you use any kind of inter-applets JavaScript communication, use Trusted-Library=true in the manifest of your JAR(s) (mandatory since the update 21).

SERIOUSLY?!

@Kevin
Do you have the OpenAL natives on the library path?

Running the applet, I also get this exception:


Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "org.lwjgl.input.Mouse.allowNegativeMouseCoords" "write")
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.security.AccessController.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Unknown Source)
	at sun.plugin2.applet.AWTAppletSecurityManager.checkPermission(Unknown Source)
	at java.lang.System.setProperty(Unknown Source)
	at com.badlogic.gdx.backends.lwjgl.LwjglNativesLoader.<clinit>(LwjglNativesLoader.java:29)

Weird thing is, I did accept the security message, no clue why this would be thrown. O_o

:headdesk:

Well, it turns out I’m an idiot. I forgot to include the permissions in the applet jnlp. Doh.

Looks like it’s working perfectly now. Not totally sure how to fix it in eclipse, but I’m not too worried about that at this point.

Thanks for your input guys, you helped me troubleshoot my stupidity!

I did it once at work, it worked very well before the update 21 when the JARs were signed but it breaks with the update 21, you have to sign the JARs and ask the permissions to get them.

Ahh, I knew something had changed with this, but I wasn’t sure what. I’ve had similar issues in the past (sometimes it’s enough to sign a jar, other times you have to ask permissions as well). I’m still not totally sure when one will work over the other, but at least I know that LWJGL requires both signing the jar and requesting permissions.