Eclipse Mars on Elementary OS

I had to deal with a monstrous-size Java project that only works with Eclipse Mars. Like a good power-user I downloaded the installer and installed it fine, started right away and worked fine.

eclipse-mars-logo

Then after lunch I tried to start up Eclipse it kept crashing and with weird errors related to GTK. Even when it didn’t crash immediately, I couldn’t access anything of the dialogs.
Tried reinstalling, and it worked again. But why?
I realized that it only worked when I started Eclipse Mars from the installer!!!

At this point I had eyebrows raised all the way to the ceiling. What the hell?
A close inspection on the eclipse.ini file showed the difference of the installer-launched Eclipse vs the installed and then launched one. It seems that by default the system goes for GTK 3 which causes things to go south.

Adding the following line to the eclipse.ini in the _installed_ eclipse folder (whereever you install it) solves the startup crash issue:

--launcher.GTK_version
2

The error you are likely to see is:

** (eclipse:29761): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-gHngtGDAY8: Connection refused
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

** (java:29763): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-gHngtGDAY8: Connection refused
org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration bundle was activated before the state location was initialized.  Will retry after the state location is initialized.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://474.fwk761973299:1/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://474.fwk761973299:2/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
org.eclipse.m2e.logback.configuration: Initializing logback
*** BUG ***
In pixman_region32_init_rect: Invalid rectangle passed
Set a breakpoint on '_pixman_log_error' to debug

This thread goes into details:
https://www.eclipse.org/forums/index.php/t/1074337/

If you are here, then you may also want to change your Eclipse theme to something non-white:
http://www.mkyong.com/eclipse/how-to-change-eclipse-theme/
http://stackoverflow.com/questions/24482920/how-can-i-properly-configure-my-eclipse-luna-dark-theme

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s