0

Eclipse 2020-09, Error:

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

enter image description here

I must set Java environment to JDK 1.8 for Gradle work correctly in some case.

enter image description here

File eclipse.ini

-startup
plugins/org.eclipse.equinox.launcher_1.5.800.v20200727-1323.jar
--launcher.library
C:\Users\donhuvy\.p2\pool\plugins\org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1300.v20200819-0940
-product
org.eclipse.epp.package.jee.product
-showsplash
C:\Users\donhuvy\.p2\pool\plugins\org.eclipse.epp.package.common_4.17.0.20200910-1200
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=11
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms256m
-Xmx2048m
--add-modules=ALL-SYSTEM
-Declipse.p2.max.threads=10
-Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/
-vm C:\Program Files\Java\jdk-15\bin\

but Eclipse still not start.

My JDKs in my PC:

enter image description here

How to declare JDK 15 to eclipse.ini ?

Naman
  • 27,789
  • 26
  • 218
  • 353
Vy Do
  • 46,709
  • 59
  • 215
  • 313

2 Answers2

3

-vm and C:\Program Files\Java\jdk-15\bin\javaw.exe have to be two lines directly before the line -vmargs, not after that line (see Eclipse wiki: eclipse.ini - Specifying the JVM):

-startup
plugins/org.eclipse.equinox.launcher_1.5.800.v20200727-1323.jar
--launcher.library
C:\Users\donhuvy\.p2\pool\plugins\org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1300.v20200819-0940
-product
org.eclipse.epp.package.jee.product
-showsplash
C:\Users\donhuvy\.p2\pool\plugins\org.eclipse.epp.package.common_4.17.0.20200910-1200
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
C:\Program Files\Java\jdk-15\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=11
-Dosgi.instance.area.default=@user.home/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms256m
-Xmx2048m
--add-modules=ALL-SYSTEM
-Declipse.p2.max.threads=10
-Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/
howlger
  • 31,050
  • 11
  • 59
  • 99
  • It still does not work https://user-images.githubusercontent.com/1328316/95893914-903a1f00-0db2-11eb-9d9b-007493d87693.png – Vy Do Oct 13 '20 at 17:17
  • after press OK https://user-images.githubusercontent.com/1328316/95895014-320e3b80-0db4-11eb-8e57-76059a9c8008.png – Vy Do Oct 13 '20 at 17:28
  • 1
    You have to remove the last line (`-vm C:\...`) since it's an illegal VM argument (all lines after `-vmargs` will be sent as arguments directly to the Java VM). – howlger Oct 13 '20 at 18:59
  • I copy your content in the answer, then it works. But I don't understand why mine does not work. Please guide me more detail, I read your comment, but I don't understand. – Vy Do Oct 13 '20 at 22:50
  • 1
    It because of the last line ([in your screenshot line 28](https://user-images.githubusercontent.com/1328316/95893914-903a1f00-0db2-11eb-9d9b-007493d87693.png): `-vm C:\Program Files\Java\jdk-15\bin\`) that is passed from the `eclipse.exe` executable to Java as an argument (because it's a line bellow the `-vmargs` line), but Java does not understand this argument and therefore refuses to start. – howlger Oct 14 '20 at 07:47
0

I get openJdk11 from: https://jdk.java.net/archive/

Then extract it local drive: (E.G.: C:\work\tool\202009\jdk-11.0.2)

Next, edit eclipse.ini, added line of code:

-vm C:\work\tool\202009\jdk-11.0.2\bin

start eclipse again will do.

AdvenC
  • 121
  • 1
  • 5