I'm developing a fairly complex Java
application mixing Swing
and SWT
. Whenever I start the application, this is the console output (and the app doesn't show up):
2012-12-19 12:45:45.359 java[3442:f07] [Java CocoaComponent compatibility mode]: Enabled
2012-12-19 12:45:45.360 java[3442:f07] [Java CocoaComponent compatibility mode]: Setting timeout for SWT to 0.100000
I've followed many guides and tutorials setting:
System.setProperty("com.apple.awt.CocoaComponent.CompatibilityMode", "false");
-XstartOnSecondThread
--launcher-on-secondThread
Now I really don't have any clue. The only way to make my app working on Mac OSX
is to export the Eclipse project to a JAR executable
. Well, this is annoying. Can someone explain to me how to set those properties above? Are there any magic trick?
EDIT: I'm using:
OSX Mountain Lion 10.8.2 ,
Java 1.6u37 64bit,
SWT 4.2 cocoa x64,
Windows XP ,
Java 1.6u37 32bit,
SWT 4.2 32bit
I've had this issue several times, as I work in a Java shop where everyone uses Eclipse, and I'm an OS X user.
The fix is a little weird.
You need to remove your current JRE from the "Installed JREs" preference, and then add it again. When you do so, make sure that you select "Standard JVM" and not "Mac OS X JVM".
Adding JREs is a little annoying, so take note of the "Location" path string before you do so. You'll point it to the same place, just change the "Type" property.
So, my answer is wrong. It's pertinent if you're doing Swing/AWT only, but humorously enough immediately after posting this I had to write an SWT_AWT boondoggle and I got the same error on my Mac, even with the above settings. I suspect that it has to do with the differences between Swing/AWT and SWT regarding the event loop (SWT = bring your own, Swing = provided by JVM). I also get the error in IntelliJ IDEA 12, so it can't just be an Eclipse issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With