Specific JDK in eclipse.ini for Eclipse IDE version 2020-09 use JDK 15, not default JDK what declared in system environment variable

huangapple go评论90阅读模式
英文:

Specific JDK in eclipse.ini for Eclipse IDE version 2020-09 use JDK 15, not default JDK what declared in system environment variable

问题

Eclipse 2020-09,错误:

JVM 版本 1.8.0_261 不适用于此产品。需要版本 11 或更高版本。

我必须将 Java 环境设置为 JDK 1.8,以便在某些情况下 Gradle 正常工作。

文件 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\

但是 Eclipse 仍然无法启动。

我 PC 上的 JDKs:

如何将 JDK 15 声明到 eclipse.ini 中?

英文:

Eclipse 2020-09, Error:

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

Specific JDK in eclipse.ini for Eclipse IDE version 2020-09 use JDK 15, not default JDK what declared in system environment variable

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

Specific JDK in eclipse.ini for Eclipse IDE version 2020-09 use JDK 15, not default JDK what declared in system environment variable

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:

Specific JDK in eclipse.ini for Eclipse IDE version 2020-09 use JDK 15, not default JDK what declared in system environment variable

How to declare JDK 15 to eclipse.ini ?

答案1

得分: 3

-vm 和 `C:\Program Files\Java\jdk-15\bin\javaw.exe` 需要直接出现在 `-vmargs` 这一行之前,而不是在该行之后(参见[Eclipse维基:eclipse.ini - 指定JVM][1]):

-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/

[1]: https://wiki.eclipse.org/Eclipse.ini#Specifying_the_JVM
英文:

-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/

答案2

得分: 0

我从这里获取 openJdk11:https://jdk.java.net/archive/

然后将其解压缩到本地驱动器:(例如:C:\work\tool\202009\jdk-11.0.2)

接下来,编辑 eclipse.ini 文件,添加以下代码行:
> -vm
C:\work\tool\202009\jdk-11.0.2\bin

重新启动 eclipse 即可。

英文:

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.

huangapple
  • 本文由 发表于 2020年10月14日 00:17:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/64339183.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定