2

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.

Sri Harsha Chilakapati
  • 11,744
  • 6
  • 50
  • 91

1 Answers1

1

There are a couple of problems.

  • The version of lwjgl that ships with the jbullet code does not work with Java 7 on Mac OS X
  • the JBullet code needs to be changed to work on the newer lwjgl

Solutions/Workarounds:

  • Use a 1.6 run-time
  • fix the jbullet code to work on a newer version of lwjgl.

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:

  • Downloaded the jbullet code
  • ran with the 1.6 VM using:

    /usr/libexec/java_home -v 1.6 --exec java -Djava.library.path=(pwd)/lib/lwjgl/macosx -cp dist/\*:(pwd)/lib/lwjgl/\* com.bulletphysics.demos.basic.BasicDemo
    

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.

Anya Shenanigans
  • 91,618
  • 3
  • 107
  • 122
  • I replaced the LWJGL jars that came with JBullet with the latest ones and it ran perfectly with Java 7. – Sri Harsha Chilakapati Nov 11 '13 at 15:20
  • I had to follow the [fixes at this link](http://blog.lolyco.com/sean/2011/05/14/trying-out-jbullet-intbuffer-is-not-direct/) to get the demo working under the newer lwjgl, so I'm surprised it worked OOB for you – Anya Shenanigans Nov 11 '13 at 15:31