Native library and LWJGL problems with JDK7 on Mac OS X

Hi,



I encounter 2 problems with jME 3 and JDK 7u4 on Mac OS X (10.7.3):


  1. The standard native library extension seems to be “.dylib” now, in contrast to “.jnilib” in older JDK versions. Therefore, the lwjgl natives are not found by jME inside its own JAR. Same thing for the libbulletjme natives. I think this could probably be addressed by providing the libraries twice, with different extensions.



    [error] 2012-05-13T15:38:13.645+02:00 SEVERE e.UpdateLoop: unhandled exception in thread Thread[LWJGL Renderer Thread,5,main]

    [error] java.lang.UnsatisfiedLinkError: Can’t load library: /Users/i0n/Documents/workspace/ecidice/liblwjgl.dylib

    [error] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1828)

    [error] at java.lang.Runtime.load0(Runtime.java:792)

    [error] at java.lang.System.load(System.java:1059)

    [error] at org.lwjgl.Sys$1.run(Sys.java:70)

    [error] at java.security.AccessController.doPrivileged(Native Method)

    [error] at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)

    [error] at org.lwjgl.Sys.loadLibrary(Sys.java:95)

    [error] at org.lwjgl.Sys.(Sys.java:112)

    [error] at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:204)

    [error] at java.lang.Thread.run(Thread.java:722)


  2. As soon as I got the above “fixed” (by changing the extension inside the JARs…), I ran into this:



    [error] _NSJVMLoadLibrary: NSAddLibrary failed for /libjawt.dylib

    [error] JavaVM FATAL: lookup of function JAWT_GetAWT failed. Exit



    A quickle web search yielded this:



    http://lwjgl.org/forum/index.php?topic=4326.0

    http://lwjgl.org/forum/index.php?topic=4326.15



    Is there anything that can be done other than waiting for a JDK7 + Mac compatible version of LWJGL? I’d hate to be stuck with Java 6 even longer :confused:

oO Whats it you need from JDK 7? Also is this the Oracle version or OpenJDK? OpenJDK is known to have compatibility issues (not just with lwjgl for that matter). Afaik the .jnilib suffix is supposed to be kept in future updates but I had a preview version of JDK that wanted .dylib’s as well thats why I am asking.

Well, for starters, a decent FileSystem API. Of course, there’s also other neat stuff like the Objects class, but I admit it’s all more me “wanting” than me “needing” these. :slight_smile:



As for your other question, yes, I’m using the official Oracle version of JDK 7.

For me it isn’t so much a question of what I need from JDK 7 as what happens with my games when Apple pushes Java 7 to all users, a theoretical questions since I actually don’t have any users :slight_smile: Still, this LWJGL-problem has me a bit worried.

1 Like

7u4 you say? That version should still contain hackish code to support jnilib files and they are apparently supposed to be supported further on: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7134690

Edit: Ah, apparently they failed to add the “better” workaround code:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7134701

1 Like

Thanks Normen for taking the time to look this up. At least they are aware of it (as are the LWJGL guys). So I guess it’s JDK 6 for now until they sort this out. OS X 10.8 is supposed to be released this Summer and JDK 7 is likely to be the only version that’ll work there, so I really hope things will improve until then.

They better fix it as Java 7 is now publicly available for download since like a week ago, n I want to use the jdk <3. Oh its a problem for Mac? nvm I dl it now ^^

I fixed the extraction of the natives in the svn version so they are extracted with whatever suffix (jnilib/dylib or w/e) the JDK wants. lwjgl is seriously broken on OSX/Java7 though, but there is (paid) work going on in this very moment to change that for the next versions.



Actually the SDK works (including OpenGL) on Java7/OSX now as only the window implementations of lwjgl are broken and the SDK uses backbuffer rendering to AWT by default. So for your own apps on OSX/Java7 they only work with AWT Panels atm.

While this is way old, is there finally any solution? or are macs still shi… snap not working

Somebody apparently wanted to fix this yeah: http://lwjgl.org/forum/index.php?topic=4711.15 I didn’t see any1 using Java7 on OSX though, why? It comes with Java 1.6

Well we use features of 1.7, and I’m stuck with a mac at work.

Just in case this wasn’t clear, this isn’t our fault. Some changes happened in Java7 / Mac and now LWJGL doesn’t run on it. There’s nothing we can do to alleviate the issue.

normen said:
Somebody apparently wanted to fix this yeah: http://lwjgl.org/forum/index.php?topic=4711.15 I didn't see any1 using Java7 on OSX though, why? It comes with Java 1.6


What are the thoughts on this w.r.t bundling a JDK with jME SDK? Personally I'd prefer the JDK wasn't bundled with the OSX SDK if jME wants to release before LWJGL has this fixed.
@jmaasing said:
What are the thoughts on this w.r.t bundling a JDK with jME SDK? Personally I'd prefer the JDK wasn't bundled with the OSX SDK if jME wants to release before LWJGL has this fixed.

orly? ^^ Yeah of course, if it doesn't work it'll not be bundled. The SDK works with Java7 on OSX though :) The problems are with the window and canvas implementations and the SDK uses backbuffers by default.
normen said:
orly? ^^ Yeah of course, if it doesn't work it'll not be bundled. The SDK works with Java7 on OSX though :) The problems are with the window and canvas implementations and the SDK uses backbuffers by default.


Yes rly :) I thought that these are the decisions that can be taken, order from great to horrible imho:

* No bundle for you OSX since you can't run java 7 and LWJGL, Mac owners can sort it out themselves. 8)
* Delay release until LWJGL has this fixed so Java 7 can be bundled. 8O
* Bundle java 6 since that at least works on all platforms. :cry:

Edit: added horror indicators.