【问题标题】:Specific JDK in eclipse.ini for Eclipse IDE version 2020-09 use JDK 15, not default JDK what declared in system environment variableEclipse IDE 版本 2020-09 的 eclipse.ini 中的特定 JDK 使用 JDK 15,而不是系统环境变量中声明的默认 JDK
【发布时间】:2020-10-13 16:17:41
【问题描述】:

Eclipse 2020-09,错误:

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

我必须将 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 仍然没有启动。

我电脑中的 JDK:

如何将JDK 15声明为eclipse.ini

【问题讨论】:

  • -vm 放在一行中,并将位置放入下一行

标签: java eclipse java-8 java-15


【解决方案1】:

-vmC:\Program Files\Java\jdk-15\bin\javaw.exe 必须在-vmargs 行之前的两行,而不是在该行之后(参见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/

【讨论】:

  • 您必须删除最后一行 (-vm C:\...),因为它是非法的 VM 参数(-vmargs 之后的所有行都将作为参数直接发送到 Java VM)。
  • 我将您的内容复制到答案中,然后就可以了。但我不明白为什么我的不起作用。请指导我更详细,我阅读了您的评论,但我不明白。
  • 这是因为最后一行(in your screenshot line 28:-vm C:\Program Files\Java\jdk-15\bin`) that is passed from the eclipse.exe` 可执行到Java 作为参数(因为它是-vmargs 行下面的一行),但Java 不明白这个论点,因此拒绝开始。
【解决方案2】:

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

然后解压到本地驱动器:(E.G.: C:\work\tool\202009\jdk-11.0.2)

接下来,编辑eclipse.ini,添加一行代码:

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

再次启动eclipse就可以了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-12
    • 2019-08-26
    • 2010-11-28
    • 2011-05-26
    • 2014-06-29
    • 2011-10-16
    • 2012-10-19
    • 2020-10-19
    相关资源
    最近更新 更多