tags:

views:

408

answers:

8

We just updated to Mac OSX 10.5.7 and now anytime I bring up any of my SwingUI based dialogs our application crashes. Literally everything was working fine I just made some good progress on the project and decided to take a break and install the update, I come back boot up the application and discover anytime a swingUI based element comes up, the application crashes. Does this seem like a plausible cause of my problem or is it just some crazy coincidence? Any one have this sort of problem after this update?

A: 

You should check the stack trace for hints. I hope you are using an IDE like eclipse or xcode. you can post the stack trace. I think that's more helpful.

Quincy
Unfortunately the project was written without an IDE and is compiled using a build.xml file with a call to ant.
Mike2012
+1  A: 

Have you tried updating the VM on your Mac? A new update came out recently:

Java for Mac OS X 10.5 Update 4 delivers improved reliability, security, and compatibility for Java SE 6, J2SE 5.0 and J2SE 1.4.2 on Mac OS X 10.5.7 and later. This release updates Java SE 6 to version 1.6.0_13, J2SE 5.0 to version 1.5.0_19, and J2SE 1.4.2 to 1.4.2_21.

akf
A: 
Chochos
A: 

It's totally possible. If the Java version was updated (which I think it was, though my 10.5.7 just asked me to update the JVM recently, weeks after I updated the OS)... Java updates have traditionally broken some Swing Apps.

If you do a java -version and your version is any of these

1.6.0_13
1.5.0_19
1.4.2_21

you can be sure that it came with the 10.5.7 update, since these are 10.5.7 and later only.

Run the java command from a command line (to see the stack trace), which will no doubt reveal the problem. If you are the developer, it should be easy to figure out which of your assumptions about how Swing works was wrong.

On the other hand, let's be scientific: it could be a coincidence :)

Yar
A: 

Apple reverted the java 5 rendering engine to quartz for some reason. You can use java 6 or try setting apple.awt.graphics.UseQuartz to false (on the command line or in Info.plist, whatever that is).

edit: a more verbose discussion on Apple's java-dev list: http://lists.apple.com/archives/java-dev/2009/Jun/msg00306.html

wds
Thank you very much for this link. Unfortunately it seems that there is no easy way to revert the java version. According to the Apple tech support rep you need to do an archive and install to a pre updated version and then choose not to install the java update when it comes up. Correct me if this is wrong I am new to macs. Also, I don't know what exactly info.plist is but it seems that the add new item is ghosted and I do not see anywhere in there to change the java rendering engine. Thanks for your help and sorry for the newbie questions.
Mike2012
I'm just relaying what I heard but yes that's basically correct. However, you can change the active jvm through the Java Preferences, see also http://developer.apple.com/java/faq/#multiple , and you can set that option I mentioned as usual java -Dapple.awt.graphics.UseQuartz=false [...]
wds
A: 

Thank you everyone for all your helpful responses. I finally got a hold of another mac to test this out on. The machine I have been having problems on is an intel based duo core Imac and I tested this on a non intel based machine and it does not crash when the SwingUi dialogs pop up. This machine was also running update 10.5.7 and java version 1.5.0_19. Does it make any sense that the problem caused by the update could be processor dependent? Or is this evidence that the problem is not related to the java or macosx version?

Mike2012
A: 

Also, if anyone is still following this thread, I got a stack trace and everything in the trace seems to be java and apple libraries. Here is the trace:

Before crash

NSRuntime.loadLibrary(/usr/lib/java/libObjCJava.dylib) error. java.lang.UnsatisfiedLinkError: /usr/lib/java/libObjCJava.A.dylib: no suitable image found. Did find: /usr/lib/java/libObjCJava.A.dylib: no matching architecture in universal wrapper at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1702) at java.lang.Runtime.load0(Runtime.java:769) at java.lang.System.load(System.java:968) at com.apple.cocoa.foundation.NSRuntime.loadLibrary(NSRuntime.java:127) at com.apple.cocoa.foundation.NSRuntime.(NSRuntime.java:35) at com.apple.cocoa.foundation.NSAutoreleasePool.(NSAutoreleasePool.java:11) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at ch.randelshofer.quaqua.util.Methods.invokeStatic(Methods.java:133) at ch.randelshofer.quaqua.QuaquaIconFactory.createApplicationImage(QuaquaIconFactory.java:242) at ch.randelshofer.quaqua.QuaquaIconFactory.getApplicationImage(QuaquaIconFactory.java:221) at ch.randelshofer.quaqua.QuaquaIconFactory.composeOptionPaneIcon(QuaquaIconFactory.java:205) at ch.randelshofer.quaqua.QuaquaIconFactory.createWarningIcon(QuaquaIconFactory.java:187) at ch.randelshofer.quaqua.QuaquaIconFactory.access$100(QuaquaIconFactory.java:37) at ch.randelshofer.quaqua.QuaquaIconFactory$1.construct(QuaquaIconFactory.java:69) at ch.randelshofer.quaqua.util.Worker.run(Worker.java:47) at java.lang.Thread.run(Thread.java:613) Warning: class ch.randelshofer.quaqua.filechooser.Files couldn't load library libquaqua.jnilib. Before crash NSRuntime.loadLibrary(/usr/lib/java/libObjCJava.dylib) error. java.lang.UnsatisfiedLinkError: /usr/lib/java/libObjCJava.A.dylib: no suitable image found. Did find: /usr/lib/java/libObjCJava.A.dylib: no matching architecture in universal wrapper at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1822) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1702) at java.lang.Runtime.load0(Runtime.java:769) at java.lang.System.load(System.java:968) at com.apple.cocoa.foundation.NSRuntime.loadLibrary(NSRuntime.java:127) at com.apple.cocoa.foundation.NSRuntime.(NSRuntime.java:35) at com.apple.cocoa.foundation.NSAutoreleasePool.(NSAutoreleasePool.java:11) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at ch.randelshofer.quaqua.util.Methods.invokeStatic(Methods.java:133) at ch.randelshofer.quaqua.QuaquaIconFactory.createApplicationImage(QuaquaIconFactory.java:242) at ch.randelshofer.quaqua.QuaquaIconFactory.getApplicationImage(QuaquaIconFactory.java:221) at ch.randelshofer.quaqua.QuaquaIconFactory.composeOptionPaneIcon(QuaquaIconFactory.java:205) at ch.randelshofer.quaqua.QuaquaIconFactory.createWarningIcon(QuaquaIconFactory.java:187) at ch.randelshofer.quaqua.QuaquaIconFactory.access$100(QuaquaIconFactory.java:37) at ch.randelshofer.quaqua.QuaquaIconFactory$1.construct(QuaquaIconFactory.java:69) at ch.randelshofer.quaqua.util.Worker.run(Worker.java:47) at java.lang.Thread.run(Thread.java:613)

Mike2012
+1  A: 

Maybe you need a newer version of the quaqua JNI libraries linked against 10.5.7?