Apple VM and Eclipse 3.3.1
If you get the ‘Java started on first thread’ AWT exception running crap4j in Eclipse, here is a fix.
Inside <eclipse install dir>/Eclipse.app/Contents/MacOs/eclipse.ini, add the following two VM switches.
-Dapple.awt.usingSWT=false
-Djava.awt.headless=true
I ran into this for the first time tonight, and not sure what changed in my Eclipse 3.3.1 install. Everything still works fine in Eclipse 3.2.2. Anyway, those two switches solved the problem. Someone else mentioned removing the -XstartOnFirstThread flag, but only the combination of the two above actually worked for me.
Why could this happen? This is a perennial problem with Apple Java and Eclipse SWT. I had long been afraid it would happen since Crap4j renders the bar graph for ‘% CRAP’ using Java 2d, which loads in AWT. However, it hadn’t blown up on the Mac until today. I hope no one else will have the problem.








