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).
7 Answers
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
-
Thanks a lot. It worked for Java. CDT is still slow though. But good for now. Apr 25, 2016 at 2:18
-
Also worked fine on a upgraded 16.04 (from 15.10). But java has according to top sometimes in idle 60% cpu usage– Motte001Apr 26, 2016 at 7:59
-
1@Motte001 - thank for the information. I also see 60% CPU usage on start up, then it drops to about 10%. Maybe when they get round to fixing Ubuntu's GT3 module, it will drop the java usage.– NickTApr 26, 2016 at 8:20
-
1
-
@NickT Thanks! Editing
eclipse.ini
solved my problem with System Workbench for STM32 on Ubuntu 16.04x64– maddouriMay 31, 2016 at 11:07
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 !
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! :)
-
I was having the same problem as the OP with Eclipse Mars which was installed before Ubuntu 16. NickT's answer resolved my issue. Oct 24, 2016 at 17:16
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
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.
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