The title of this post is a bit misleading in that you apparently cannot run Eclipse on a MacBook Pro with Java 6 set as the default JDK. Never mind that it took Apple a year and a half after the release of Java 6 for Apple to support Java 6 on OS X in the first place. I thought Apple was “developer friendly”? My experience on a Mac has usually been slightly better than working on a PC, except that the failings of a PC can usually be dismissed as Microsoft’s incompetence. Apple seems to act more like a highly-opinionated jerk.
After I upgraded to Java 6 (and then had to manually change my JDK symlink even after the upgrade), Eclipse refused to start. The system log showed:
[0x0-0xa90a9].org.eclipse.eclipse: _NSJVMLoadLibrary: NSAddLibrary failed for /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Libraries/libjvm.dylib
[0x0-0xa90a9].org.eclipse.eclipse: JavaVM FATAL: Failed to load the jvm library.
To resolve the issue, I edited
/Applications/eclipse/Eclipse.app/Contents/Info.plist, and uncommented this line:
Problem solved. Apparently Eclipse uses 32-bit SWT-Cocoa bindings, and Apple just decided that they weren’t going to support 32-bit SWT any more in Java 6, breaking any app that uses them in the process. So the fix is to just run Eclipse under Java 5 (Java 6 projects still work in this setup). I’m starting to lose track of the consumer-unfriendly attitudes I’ve experienced from Apple. Their version of Java 6 is late, incomplete, and lazy.
I will declare this now – Apple is every bit as evil as Microsoft. If Apple EVER gets the market share that Microsoft once held, Microsoft’s anti-trust violations will seem like trivial misdemeanors compared to what Apple would do with such power. I need to gather my thoughts on this soon and elaborate on this point.
30 thoughts on “Running Eclipse on MacBooks with Java 6”
This info was extremely helpful to me. Thank you!
Thank you for helping me get Eclipse running!
Glad this helped – I figured it would be an problem more and more people would discover, with very few solutions available.
Thank you very much =)
Thanks for the info – I experienced the exact same problem.
Additionally, I found an application I was running within Eclipse with Java 6 would throw OutOfMemoryException errors. My colleagues running the same setup under Windows had no such problem.
Found that adding the -server JVM argument fixed the problem.
Hi, I’d like to know what is the database design plugin to eclipse? Can you help me?
Glad to help folks.
Celso, I am not familiar with the plugin you’re looking for. Wish I could help.
Cheers for helping me out on this one 🙂
First off Apple never supported SWT direct, it’s an Eclipse specific technology maintained by the Eclipse Foundation. Second, then entire JDK is 64-bit, not just the “bindings”. Lastly, SWT uses Carbon, not Cocoa. So I don’t know if I’d declare Apple evil when it’s IBM that decided to go their own way with SWT and made the promise of “write once, run anywhere” a bit more dodgy. Granted, SWT gave Sun a swift kick in the nuts to improve Swing, and I find that it is now a hell of a lot better. But SWT is still always going to play second fiddle on Mac OS X because it is a tier 2 platform for Eclipse. And yes, I hate it every bit as much as you because NetBeans still isn’t there and Idea is still out of my price range.
Give me a break. Don’t blame Apple for Eclipse lameness. Apple is far from prefect, but I don’t blame them for this at all.
SWT is not a part of Sun’s Java. Why should Apple be responsible for supporting it? Should they support every third party library? The people responsible for Eclipse created SWT and orignally just provided Linux and Windows versions – breaking Java’s write once run everywhere promise – nice. The community then decided they’d take up this slack and ported it to the Mac. It guess it was nice of them, but they should be responsible for maintaining it.
Eclipse is OK (especially for free) but there are better java development tools available for the Mac that work with the current releases of Java. Xcode, Netbeans and Intellij’s IDEA all come to mind.
Sam – I blame Apple for abandoning 32-bit Java – are they not responsible for maintaining that? With large numbers of their own customers still on 32-bit platforms, and plenty of apps with 32-bit dependencies, Apple knew some people were going to end up stuck. Anyone on a 1st gen MacBook Pro now has to buy a new Mac if they want to develop Java 6 – those laptops aren’t even 3 years old and they are a dead end for Java development now.
SWT would work fine if Apple had bothered to retain compatibility for 32 bit platforms. Yes, SWT is weird and I don’t really care for it. IDEA is just too resource intensive on large projects. Eclipse scratches my itch. Some folks like TextMate. That’s fine. Based on the traffic this post gets, I think lots of people ran into this issue, and find developing in Eclipse on their Mac enjoyable.
Thank you very much! Finally got eclipse working on my new Mac!
This is very helpful. Just to make a note for people who know nothing about Mac (like myself),
Eclipse.app is not seen from the Finder UI. I have to go through command line to enter that folder.
Mac basically put an UI on top of a free OS kernel and add a bunch of “glossy” useless apps.
Piece of junk!
Thanks. This was very helpfull. Took me a while get the java 6 upgrade to work with maven, and when it finally did, eclipse crashed. This worked just great. Thanks
thanks, that did the trick. and yes, it’s annoying that java is not “better” supported and integrated by Apple…
Note – the Galileo release of Eclipse has an implementation of SWT using Cocoa. That means it “just works” with the Mac OS X Java 1.6 now. No modifications needed.
This is another big THANK YOU to posting your findings!!
Thanks for this,
I made the change – seemed straightforward enough but the Eclipse icon at the finder still has a line through it and consequently will not run. The message is still:
You can’t open the application “Eclipse” because it’s not supported on this type of Mac.
What do I do next?
Thanks for the glimmer of hope.
I wish I had more suggestions. It’s been a long while since I looked at this, and I really don’t know what to suggest. I haven’t even used Eclipse in a few years.
Comments are closed.