Fork me on GitHub
Subscribe to RSS Feed

Neil Bartlett

Eclipse on SoyLatte without X11

An article by Cade Metz in The Register suggests that Apple’s deprecation of Java is an attack on Android developers:

“If you don’t have Java on the Mac, you can’t run Java development tools such as Eclipse, IntelliJ, and NetBeans. And though there is a port of OpenJDK for the Mac, it’s not quite complete. It’s limited to the X11 windows system, and there’s no support for native Mac GUIs.

“The other salient point here is that if you don’t have Java on the Mac, you can’t use Google’s Android SDK. Most Android development is done on Eclipse, and though Eclipse isn’t required by the SDK, the Java environment is.”

Don’t believe everything you read in El Reg, folks. Eclipse runs just fine on that OpenJDK port (a.k.a. SoyLatte) without X11. Here’s a screenshot:

No, I can’t tell a difference from normal Eclipse either, at least visually. It does feel a bit sluggish, so I assume that SoyLatte is not heavily optimised. But that’s a fixable problem.

SWT is the key. All the UI customisation work that Apple has put into its JVM was required to support Swing/AWT, which Eclipse does not use. Therefore Eclipse — and Google’s Android tools — will work fine, even if Apple eradicates its JVM from future Mac OS releases and refuses to give its UI code to OpenJDK. The same goes for Eclipse RCP applications such as Vuze and RSSOwl.

Sadly the same may not be true of NetBeans and IntelliJ, since they build on a GUI technology that is both tightly coupled to the JVM and requires extensive customisation by the operating system vendor. I wouldn’t miss those other IDEs myself, but it’s good to have choice in the market, so I hope the situation improves for them soon.

One more screenshot, here is the Eclipse 4.0 early access release:

UPDATE: David asked in the comments how to actually run Eclipse on SoyLatte. It’s quite simple. You need to open up the Eclipse.app launcher and edit the file Contents/MacOS/eclipse.ini. Assuming you have SoyLatte installed at /usr/local/soylatte16-amd64, insert the following two lines:

-vm
/usr/local/soylatte16-amd64/bin/java

These two lines must go above the -vmargs line.