I'm having trouble running Eclipse Mars x64 on Elementary OS. I get to the splash screen and then my computer freezes I have to hard restart it. I'm using the Oracle JDK for Java 8.

  • Can you run the program from terminal and paste the output here?
    – Lewis Goddard
    Commented Aug 14, 2015 at 6:14
  • Just for a note, I used the solution, the same problem happened with GTK2 by the way. Also, I had changed the vm sizes, but the problem remained. Using Luna instead of Mars needed no changes or fixes as such. Commented Oct 1, 2015 at 10:04

4 Answers 4


It's a bug in the SWT porting on GTK3. There is no real solution, but there is a workaround by forcing Eclipse to use GTK2.

I assume your Eclipse folder is /opt/eclipse and that you don't have write permissions in this folder. Please change the commands, if your set-up differs.

There are two ways to apply this workaround, a long and explanatory way, and a short one for the lazy ;)

1. Modifying eclipse.ini by hand

You need to open eclipse.ini in your Eclipse folder:

sudo -i scratch-text-editor /opt/eclipse/eclipse.ini

and add the following lines:


It's important to add these lines before --launcher.appendVmargs, otherwise Eclipse will crash.

2. Using the command sed

An easier way to make these changes is to use sed. Copy&pase this command in your terminal and press Enter:

sudo sed -i '/--launcher.appendVmargs/ i \--launcher.GTK_version\n2' /opt/eclipse/eclipse.ini

Your Eclipse should work properly from now on.

  • From your comment it seems like the issue is with GTK3 so the resolution would be to force GTK2. But your instructions for editing eclipse.ini set the GTK version to 3. I had issues with this until I set it to GTK2, seems to be working now.
    – zlalanne
    Commented Aug 15, 2015 at 1:31
  • Ops, you are right... stupid me! I have changed the values, the answer should be correct now :)
    – Rafael
    Commented Aug 15, 2015 at 9:18
  • I applied the first solution and it worked, thank you! although I would like to know what is the different between gtk2 and gtk3. Will I get a lower or worse performance to downgrading whatever that is? (if I remember correctly it's a GUI thing but I am not sure what so that's why I am asking).
    – dabadaba
    Commented Oct 1, 2015 at 12:46
  • also when launching eclipse I get a bunch of warning like "Gtk-Message: Failed to load module "pantheon-filechooser-module"", also a Gtk-Warning about a module "pixmap" and these too: "Gtk-Message: Failed to load module "canberra-gtk-module"", "Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0", "Gtk-Message: Failed to load module "pantheon-filechooser-module"" is there any way I can fix these warnings?
    – dabadaba
    Commented Oct 1, 2015 at 12:47
  • Another option (simpler IMO) to disable GTK3 is to set an environment variable (for example in your session profile file) SWT_GTK3=0.
    – Guss
    Commented Feb 26, 2017 at 17:04

Thanks, adding the lines


to the STS.ini file works fine for me.


This is a known bug (see Launchpad). Unfortunately there is no solution yet.

  • Please, don't advise anyone to run an application as root.
    – Rafael
    Commented Aug 14, 2015 at 8:29
  • You are right. Deleted workaround.
    – bigbang
    Commented Aug 14, 2015 at 9:16

this problem is because of gtk error,so its does not intializing graphics for eclipse.add type the command in the command promt- sudo -i scratch-text-editor /opt/eclipse/eclipse.ini

and add the following line- launcher.GTK_version 2

last of page .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.