Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse - Incompatible JVM. Version 1.8.0_261 of the JVM is not suitable for this product. Version: 11 or greater is required

Tags:

java

eclipse

I just downloaded Eclipse as an archive and installed newest 64 bit Java and 64 bit Java Development Kit 15. And I get this error. I installed JDK 11 after and got the same error.

How can I make this work?

like image 264
CommanderCat Avatar asked Sep 21 '20 16:09

CommanderCat


People also ask

How do I enable Java 11 in Eclipse?

A Java 11 JRE is recognized by Eclipse for launching. It can be added from the Window > Preferences > Java > Installed JREs > Add... page. It can also be added from the Package Explorer using the project's context menu.

What version of Eclipse works with Java 11?

Eclipse 4.17 (2020-09) A Java 11 or newer JRE/JDK is required, LTS release are preferred to run all Eclipse 2020-09 packages based on Eclipse 4.17, as well as the Installer.


Video Answer


3 Answers

The Java to run Eclipse can be specified in the eclipse.ini file (see Eclipse wiki: eclipse.ini - Specifying the JVM). Add the following two lines directly before the line -vmargs and adapt the path to your Java 11 or higher 64-bit Java VM installation directory:

-vm
C:\Program Files\AdoptOpenJDK\jdk-14.0.2.12-openj9\bin\javaw.exe

Alternatively, you can put the Java VM into the jre subdirectory of the Eclipse installation or, if you do not install Eclipse but upgrade it, install Java 11 or better Java 14 as plugin before the upgrade from Eclipse JustJ (use JustJ OpenJDK Hotspot JRE Complete, not Base or Minimal).

Please note, that even if you run Eclipse with Java 11 or higher, Eclipse 2020-09 (4.17) still supports to code in Java 14, 13, 12, 11, 10, 9, 8 and even much older versions (down to Java 1.1). Java 15 can be installed via Marketplace.

like image 147
howlger Avatar answered Oct 22 '22 19:10

howlger


I got it resolved by adding the vm parameters in the Eclipse configuration file at the top.

Enter image description here

In text format

-vm
C:\Program Files\Java\jdk-11.0.9\bin\javaw.exe
-startup
plugins/org.eclipse.equinox.launcher_1.5.800.v20200727-1323.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1300.v20200819-0940
-product
org.eclipse.epp.package.jee.product
-showsplash
org.eclipse.epp.package.common
--launcher.defaultAction
openFile
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=11
[email protected]/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms256m
-Xmx2048m
--add-modules=ALL-SYSTEM
like image 21
Napolean Avatar answered Oct 22 '22 19:10

Napolean


This works for me. Make sure you add -vm(Path_Of_Jdk) on top of -vmargs of eclipse.ini

E.g.,

-vm
C:\Program Files\Java\jdk-11.0.10\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=11
like image 27
Ramjay Romorosa Avatar answered Oct 22 '22 17:10

Ramjay Romorosa