无法使用 Java 10.0.1 运行 Eclipse
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50109045/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't run Eclipse with Java 10.0.1
提问by Stavros Argyrides
I have updated my Java to version 10.0.1
and now I can't run Eclipse anymore.
我已将我的 Java 更新到版本10.0.1
,现在我无法再运行 Eclipse。
It shows this message:
它显示此消息:
a java runtime environment (JRE) or Java development Kit(jdk) must be available in order to run eclipse. No Java virtual machine was found after searching the following locations:
C:\Program Files\Java\ire1.8.0_144\bin
必须有一个 Java 运行时环境 (JRE) 或 Java 开发工具包 (jdk) 才能运行 eclipse。搜索以下位置后未找到 Java 虚拟机:
C:\Program Files\Java\ire1.8.0_144\bin
I tried from advance settings to insert a new path but doesn't work.
我尝试从高级设置插入新路径,但不起作用。
采纳答案by Zabuzard
Instructions
指示
(ignore that the images don't show Java 10 but Java 9 and 8 instead)
(忽略图像不显示 Java 10,而是显示 Java 9 和 8)
First step is that you need to download a JDK 10(download). Then set your Windows Path
system environment variable to point to the bin
directory of your JDK 10 and remove the entry to the old java version (see the tutorial). Looks like this on my end:
第一步是您需要下载JDK 10(下载)。然后将您的 WindowsPath
系统环境变量设置为指向bin
JDK 10的目录并删除旧 Java 版本的条目(请参阅教程)。看起来像这样:
This variable defines where Windows will look for commands. Try it out by typing in java -version
into your cmd
:
此变量定义 Windows 将在哪里查找命令。通过在java -version
您的cmd
:
If it reads Java 10it worked.
如果它读取Java 10,则它起作用了。
After that you need to set your Eclipse to Java 10. Therefore, first add the JDK as possible JRE for Eclipse. Go to Window > Preferences > Java > Installed JREs
and add it:
之后,您需要将 Eclipse 设置为 Java 10。因此,首先添加 JDK 作为 Eclipse 的 JRE。转到Window > Preferences > Java > Installed JREs
并添加它:
Last step is that you need to tell your project to use this entry now. Go to Properties > Java Build Path
of your project and edit the JRE it uses:
最后一步是你需要告诉你的项目现在使用这个条目。转到Properties > Java Build Path
您的项目并编辑它使用的 JRE:
Eclipse and Java 10
Eclipse 和 Java 10
Note that Eclipse does not really supportJava 10 yet.
需要注意的是Eclipse中并没有真正支持的Java 10还。
Oxygenhas an early draft that supports it, but it may be difficult to get all plugins going. See here.
Oxygen有一个支持它的早期草案,但可能很难让所有插件都运行起来。见这里。
Photonwill support it when released in June. The early build of Photon doesn't support it yet. See here.
Photon将在 6 月发布时支持它。Photon 的早期版本尚不支持它。见这里。
回答by Bungler
I was able to resolve this issue by updating Eclipse through their installer tool.
我能够通过他们的安装程序工具更新 Eclipse 来解决这个问题。
First of all, try updating the config of your current installation. It's called eclipse.ini
and it's going to be in the original installation directory. Mine looks somewhat like this:
首先,尝试更新当前安装的配置。它被调用eclipse.ini
,它将位于原始安装目录中。我的看起来有点像这样:
[...]
openFile
--launcher.appendVmargs
-vm
C:\Program Files\Java\jre-10.0.1\bin <--Change this to the correct JRE path
-vmargs
-Dosgi.requiredJavaVersion=1.8
[...]
If that doesn't work, try:
如果这不起作用,请尝试:
- Install JRE 10. Look at the first part of
Zabuza
's answer for instructions. - Download the Eclipse Installer (http://eclipse.mirror.rafal.ca/oomph/epp/oxygen/R2/eclipse-inst-win64.exe)
- Update the installer if it requires one. There will be a notification when you launch it; click it and the installer will update and restart.
- 安装 JRE 10。查看
Zabuza
答案的第一部分以获取说明。 - 下载 Eclipse 安装程序 ( http://eclipse.mirror.rafal.ca/oomph/epp/oxygen/R2/eclipse-inst-win64.exe)
- 如果需要,请更新安装程序。启动时会有提示;单击它,安装程序将更新并重新启动。
- Choose a product from the list. I chose one that I already had installed.
- Change the Eclipse version if you'd like. I stuck with Oxygen.
- Browse to where you installed your jre 10 version and click next.
- 从列表中选择一个产品。我选择了一个我已经安装过的。
- 如果您愿意,可以更改 Eclipse 版本。我坚持使用氧气。
- 浏览到您安装 jre 10 版本的位置,然后单击下一步。
- Check a project to download if you want. I didn't download any of them. Click next.
- Continue through the installation and specify your preference for it's location. I chose to install in the same location. This should not touch any of your project files.
- Choose a location for the workspace. I chose the original location.
Eclipse should open with the welcome page. Click File > Open Project from File System, and it will import your project.
You may have to repeat the part at the top and edit the
eclipse.ini
of at lease check that it is still updated.
- 如果需要,请检查要下载的项目。我没有下载任何一个。点击下一步。
- 继续安装并指定您对其位置的偏好。我选择安装在同一位置。这不应涉及您的任何项目文件。
- 为工作区选择一个位置。我选择了原来的位置。
Eclipse 应该打开欢迎页面。单击文件 > 从文件系统打开项目,它将导入您的项目。
您可能需要重复顶部的部分并编辑
eclipse.ini
至少检查它是否仍在更新。