3

I have installed Java 9 JDK on my Ubuntu. Now I need to install Eclipse. I have downloaded and extracted Eclipse Mars to /opt folder. When I started eclipse from console I got error:

gedas@gedas-Latitude-E5450:/opt$ cd eclipse
g@g-Latitude-E5450:/opt/eclipse$ ./eclipse 
Unrecognized VM option 'MaxPermSize=256m'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
g@g-Latitude-E5450:/opt/eclipse$ 

And message box:

JVM terminated. Exit code=1
/usr/bin/java
-Dosgi.requiredJavaVersion=1.7
-XX:MaxPermSize=256m
-Xms256m
-Xmx1024m
-jar /opt/eclipse//plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
-os linux
-ws gtk
-arch x86_64
-showsplash /opt/eclipse//plugins/org.eclipse.platform_4.5.2.v20160212-1500/splash.bmp
-launcher /opt/eclipse/eclipse
-name Eclipse
--launcher.library /opt/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.300.v20150602-1417/eclipse_1612.so
-startup /opt/eclipse//plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.appendVmargs
-exitdata 121800e
-product org.eclipse.epp.package.cpp.product
-vm /usr/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.7
-XX:MaxPermSize=256m
-Xms256m
-Xmx1024m
-jar /opt/eclipse//plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar 

java -version returns

java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+111)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+111, mixed mode)

How to fix this problem?

  • 1
    Java 9 is planned to be released finally in 2017, so if you use Java 9, that's an early development version. You have to expect encountering many bugs in that and I'm afraid we can't help you with that here. File a bug report against your Java build and talk directly to the developers. We can't fix their code from here, and that's probably the only way to solve the problem. – Byte Commander Apr 6 '16 at 12:58
  • So, I need to remove java 9 and place java 8. But how to remove java 9 now? – vico Apr 6 '16 at 13:32
  • That depends on how you installed it. – Byte Commander Apr 6 '16 at 13:36
  • Something like that: sudo apt-get updatesudo add-apt-repository ppa:webupd8team/java sudo add-apt-repository ppa:webupd8team/java sudo apt-get install oracle-java9-installer – vico Apr 6 '16 at 13:37
  • I would recommend you to install the ppa-purge tool and let it remove that entire java PPA together with all packages from it. I am not sure if simply purging the installer package (sudo apt-get purge oracle-java9-installer)would also remove the real Java installation. – Byte Commander Apr 6 '16 at 13:40
2

so solution is you have to change default jdk by following command

sudo update-alternatives --config java

And select different entry for jdk path eg:- 1 or 2 or 3 any and enter you have to change entry from default to some different jdk

This will work 100%

  • Best solution ! Instead of removing the JDK or waiting for a Eclipse dev release, this fixes the problem without having to loose JShell ! +1111 – LMD Sep 24 '18 at 17:09
1

This is probably Eclipse bug 489958 which is marked as being fixed in Eclipse Neon milestone 7 (4.6M7) which is not yet available.

Eclipse Mars is really intended to be used with the current Java 8 release rather than Java 9 early access releases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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