Ubuntu: Eclipse not working in 16.04



Question:

Eclipse was working as good as anything on 14.04. I did a clean install of 16.04 and installed Eclipse. But it runs a Java program only once after which it just hangs during subsequent attempts before I remove and reinstall it. I have tried many things, since in the beginning I needed CDT as well. Right now, I just want to remove everything related to eclipse and do a fresh install (remove all the configs and dependencies). Please note that I used Eclipse installer to install Eclipse and the eclipse icon image is also not appearing (the default ubuntu ? is appearing).


Solution:1

I had something the same with 16.04 and Eclipse Mars. I thought it had frozen but in fact it was running very, very slowly. The problem is the version of GTK+ 3, shipped with 16.04. Fortunately the solution is very easy. Open a terminal and then type export SWT_GTK3=0, then start Eclipse from the terminal. If that works, then a more persistent fix is to put the 2 lines below, as they appear in your eclipse.ini:

--launcher.GTK_version  2  

before the line:

--launcher.appendVmargs  

The bug is filed with Ubuntu at bug 1552764


Solution:2

Thanks for the tip.

I had to change required version of java from :

-Dosgi.requiredJavaVersion=1.7  

into

-Dosgi.requiredJavaVersion=1.8  

and remove this line as well :

-XX:MaxPermSize=256m  

Happy coding !


Solution:3

Edit eclipse.desktop as following:

Exec=env SWT_GTK3=0 eclipse  


Solution:4

My recomendation is that you install Eclipse Mars from the webpage: http://www.eclipse.org/downloads/index-developer.php?release=mars

But first you have to install java8 (not java9 because Eclipse Mars doesn't work with that version). In Ubuntu you can do this with: sudo apt-get install openjdk-8-jre openjdk-8-jdk

And then .. and just if you have other java version, you have to select java8 with this command: sudo update-alternatives --config java

Voilà! That worked for me! :)


Solution:5

By starting the application from the command line (the terminal) it is sometimes possible to get more information about why the program fails to start. For example (assuming that eclipse is in your path, otherwise start it from the folder where it is installed/unpacked):

user@machine:~$ eclipse  Unrecognized VM option 'MaxPermSize=256m'  Error: Could not create the Java Virtual Machine.  Error: A fatal exception has occurred. Program will exit.  

In this case it looks like the line

-XX:MaxPermSize=256m  

in the file eclipse.ini is the problem. Simply remove that line (create a backup of the eclipse.ini file first) and try to start the program again.

Above solution worked on Eclipse Version: Mars.2 Release (4.5.2) on a machine upgraded from 15.10 to 16.04


Solution:6

Apparently this is a known bug in Ubuntu 16.04. This affects not only eclipse but several other applications too.

Before the fix is released here is a quick fix that works. Open terminal and type

$ initctl restart unity-panel-service  

This will bring back the Menus for the current session. But you may want to do this again if you restart your machine.


Solution:7

If you're getting an error for libjavascriptcoregtk-4.0 or WTFCrash, try installing libwebkitgtk-3.0-0:

sudo apt install libwebkitgtk-3.0-0


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »