Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.


I've been trying for hours now to make java 3d work on my macbook and I can't figure out what's wrong with it... Here is what I've done:
- I downloaded java3d 1.5 and replaced the original files in /System/Library/Java/Extensions.
- I then installed JOGL following a tutorial in the same (...)/Java/Extensions folder.
- As it still did not work, I decided to try the original version of java3d so I renamed the files.

I'm working on a Mac os x mountain lion with java 1.7.0_07 Here is a result of a java -version:

    java version "1.7.0_07"
    Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
    Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

Here is the content of my Java/extensions folder:

    AppleScriptEngine.jar   gluegen-rt.jar          j3dutils.jar.new        libAppleScriptEngine.jnilib libgluegen-rt.jnilib            libnewt.jnilib
    MRJToolkit.jar          j3daudio.jar            jai_codec.jar           libJ3D.jnilib               libjogl_desktop.jnilib          mlibwrapper_jai.jar
    QTJava.zip              j3dcore.jar             jai_core.jar            libJ3DAudio.jnilib          libmlib_jai.jnilib              vecmath.jar
    dns_sd.jar              j3dcore.jar.new         jogl-all.jar            libJ3DUtils.jnilib          libnativewindow_awt.jnilib      vecmath.jar.new
    gluegen-java-src.zip    j3dutils.jar            jogl-java-src.zip       libQTJNative.jnilib         libnativewindow_macosx.jnilib

I can compile java 3d codes with javac but here is the result when I try to launch it:

    $> java Hello3d
    JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM
    AWT not found
    Exception in thread "main" java.lang.NoClassDefFoundError: apple/awt/CGraphicsDevice
        at javax.media.j3d.GraphicsConfigTemplate3D.<clinit>        (GraphicsConfigTemplate3D.java:55)
        at com.sun.j3d.utils.universe.SimpleUniverse.getPreferredConfiguration(SimpleUniverse.java:368)
        at com.sun.j3d.utils.universe.Viewer.<init>(Viewer.java:348)
        at com.sun.j3d.utils.universe.Viewer.<init>(Viewer.java:298)
        at com.sun.j3d.utils.universe.SimpleUniverse.<init>(SimpleUniverse.java:215)
        at com.sun.j3d.utils.universe.SimpleUniverse.<init>(SimpleUniverse.java:177)
        at com.sun.j3d.utils.universe.SimpleUniverse.<init>(SimpleUniverse.java:88)
        at Hello3d.<init>(Hello3d.java:13)
        at Hello3d.main(Hello3d.java:27)
    Caused by: java.lang.ClassNotFoundException: apple.awt.CGraphicsDevice
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        ... 9 more

The java class that I'm trying to launch comes from the official tutorial.

Do you have any idea how I could fix this?
Thanks for your help!

share|improve this question
add comment

1 Answer

I'm afraid that Java3D 1.5 is incompatible with newer versions of OSX, there's nothing you can do.

I've forked the Java3D code and replaced the native code backends with a JOGL2 backend

You can find information about installing JOGL2 on OSX here (where there is also a Java3d forum available): http://jogamp.org/

And you can get prebuilt jar files for my Java3d here (under downloads):

https://github.com/hharrison/

(j3d-core, j3d-utils, vecmath)

Fair warning, this only works with Java6 on OSX currently, I've been trying to debug the problems with Java7 on OSX, but have no ETA for a solution.....good luck!

share|improve this answer
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["        <li><a href=\"http://area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"http://careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2014 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2014.3.15.1463\r\n            </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Stack Overflow works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\r\n    </nos"], "copyright__copyright__copyright": [" Java3d here (under downloads):\n\nhttps://github.com/hharrison/\n\n(j3d-core, j3d-utils, vecmath)\n\nFair warning, this only works with Java6 on OSX currently, I've been trying to debug the problems with Java7 on OSX, but have no ETA for a solution.....good luck!\n\nshare|improve this answer\nshow 1 more comment\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}