Crash with Java 7 and Macos 10.9.1

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Crash with Java 7 and Macos 10.9.1

Pierre Nugues
I have a Java program using Jogamp and Jogamp's implementation of Java 3D. It works fine with Java 6, but it crashes with Java 7. Here is what I get:

JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM
AWT not found
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: apple/awt/CGraphicsDevice
at javax.media.j3d.GraphicsConfigTemplate3D.<clinit>(GraphicsConfigTemplate3D.java:55)
at javax.media.j3d.GraphicsConfigTemplate3D.<clinit>(GraphicsConfigTemplate3D.java:55)
at com.sun.j3d.utils.universe.SimpleUniverse.getPreferredConfiguration(SimpleUniverse.java:368)
... and then my code.

Do you have an idea how to solve this?

Reply | Threaded
Open this post in threaded view
|

Re: Crash with Java 7 and Macos 10.9.1

gouessej
Administrator
Hi

Please reproduce it with a tiny test case. However, in my humble opinion, there is still a conflict with an old version of Java3D which is used only when you switch to Java 7 as you get the same crash than here:
http://stackoverflow.com/q/12738469
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Crash with Java 7 and Macos 10.9.1

Pierre Nugues
Thank you for the help.

I had Java 3D files in the /System/Library/Java/Extensions folder, which I think have been reinstalled by Maverick:

AppleScriptEngine.jar libAppleScriptEngine.jnilib
MRJToolkit.jar libJ3D.jnilib
QTJava.zip libJ3DAudio.jnilib
dns_sd.jar libJ3DUtils.jnilib
j3daudio.jar libQTJNative.jnilib
j3dcore.jar libmlib_jai.jnilib
j3dutils.jar mlibwrapper_jai.jar
jai_codec.jar vecmath.jar
jai_core.jar

I removed j3dutils.jar, j3dcore.jar, vecmath.jar, libJ3D.jnilib, and libJ3DUtils.jnilib
and I set
<sysproperty key="java.library.path" path="../java3d/jogamp-all-platforms/lib/macosx-universal"/>

in my ant file. I still get this error:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no J3D in java.library.path

Do you have clue?

Thank you in advance...
Reply | Threaded
Open this post in threaded view
|

Re: Crash with Java 7 and Macos 10.9.1

hharrison
In reply to this post by Pierre Nugues
This error is almost always caused by having Java 1.5.2 somewhere in your classpath.

Harvey
Reply | Threaded
Open this post in threaded view
|

Re: Crash with Java 7 and Macos 10.9.1

gouessej
Administrator
In reply to this post by Pierre Nugues
Harvey is right and you don't have to set the Java library path when using Java3D 1.6 as it relies on JOGL 2 which is able to extract and load the correct native libraries from its JARs. As I wrote in my tutorial, the old versions of Java3D must be totally removed to avoid any conflict and you must never install JOGL or Java3D as an extension or in the JVM.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Crash with Java 7 and Macos 10.9.1

Pierre Nugues
I solved the problem by removing the /System/Library/Java/Extensions folder as, apparently, the JVM reads it before the manifest.

Thank you for your help.
Reply | Threaded
Open this post in threaded view
|

Re: Crash with Java 7 and Macos 10.9.1

gouessej
Administrator
That's drastic :) Thank you for your feedback. I know it's painful to have to do that.
Julien Gouesse | Personal blog | Website