javamacosruntime-errorlwjgljawt

Could not get the JAWT interface error on mac


I'm trying to run the Basic Demo of the JBullet library. However it's giving saying JAWT interface couldn't be found. It works fine on Windows 8 Pro and Ubuntu 13.10 (I've tested them on my laptop) but not on my mac running OS X 10.8.5 with Oracle Java 7.

enter image description here

Here's the complete exception.

org.lwjgl.LWJGLException: Could not get the JAWT interface
    at org.lwjgl.opengl.AWTSurfaceLock.lockAndInitHandle(Native Method)
    at org.lwjgl.opengl.AWTSurfaceLock.access$100(AWTSurfaceLock.java:49)
    at org.lwjgl.opengl.AWTSurfaceLock$1.run(AWTSurfaceLock.java:89)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.lwjgl.opengl.AWTSurfaceLock.privilegedLockAndInitHandle(AWTSurfaceLock.java:86)
    at org.lwjgl.opengl.AWTSurfaceLock.lockAndGetHandle(AWTSurfaceLock.java:64)
    at org.lwjgl.opengl.MacOSXCanvasPeerInfo.initHandle(MacOSXCanvasPeerInfo.java:53)
    at org.lwjgl.opengl.MacOSXDisplayPeerInfo.doLockAndInitHandle(MacOSXDisplayPeerInfo.java:56)
    at org.lwjgl.opengl.PeerInfo.lockAndGetHandle(PeerInfo.java:85)
    at org.lwjgl.opengl.MacOSXContextImplementation.create(MacOSXContextImplementation.java:46)
    at org.lwjgl.opengl.Context.<init>(Context.java:113)
    at org.lwjgl.opengl.Display.create(Display.java:783)
    at org.lwjgl.opengl.Display.create(Display.java:733)
    at com.bulletphysics.demos.opengl.LWJGL.main(LWJGL.java:54)
    at com.bulletphysics.demos.basic.BasicDemo.main(BasicDemo.java:228)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.sun.javaws.Launcher.executeApplication(Unknown Source)
    at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
    at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
    at com.sun.javaws.Launcher.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:724)

Can anybody say what is the cause of it?

Thanks.


Solution

  • There are a couple of problems.

    Solutions/Workarounds:

    Note: You cannot use the webstart launcher for the demo if you've got Java 7 installed; it will simply not work.

    What I did to get it to work:

    In this case, I installed the full 1.6 JDK from the apple downloads site; I think you can do /usr/libexec/java_home -R -v 1.6 to get it to explicitly install the 1.6 JRE, which should work with this demo.