Java 未找到指定的 VM 安装:键入标准 VM,名称为 jre7

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21296620/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 07:57:17  来源:igfitidea点击:

Specified VM install not found: type Standard VM, name jre7

javaeclipseant

提问by Shanewaj

Specified VM install not found: type Standard VM, name jre7 Have you ever encountered this problem in Eclipse while building an ant file? Then this article is for you. Deleting and recreating the workspace is not the solution. There is an easy solution to fix this issue without recreating the workspace.

未找到指定的 VM 安装:类型 Standard VM,名称 jre7 您在 Eclipse 中构建 ant 文件时是否遇到过这个问题?那么这篇文章是给你的。删除并重新创建工作区不是解决方案。有一个简单的解决方案可以在不重新创建工作区的情况下解决此问题。

enter image description here

在此处输入图片说明

采纳答案by Shanewaj

Best answer found at

最佳答案在

It happened for me after Un-installing Java and installing new version.

在卸载 Java 并安装新版本后,这对我来说发生了。

All I have to do is in eclipse open Installed JREs from Windows --> Preferences --> Java --> Installed JREs

我所要做的就是在 Eclipse 中打开 Installed JREs from Windows --> Preferences --> Java --> Installed JREs

Then Add new JRE information. Details can be found here

然后添加新的 JRE 信息。详细信息可以在这里找到

回答by Whome

This is a preferred way tell projects which JDK container to use, especially true if two or more devs are using the same version controlled eclipse project folder.

这是告诉项目使用哪个 JDK 容器的首选方式,尤其是如果两个或多个开发人员使用相同的版本控制的 eclipse 项目文件夹。

Window/Preferences/Java/Installed JREs
List one or more JDKs installed on your computer. Eclipse defaults name to jdk1.X.X_XX you should keep it as is. Never link project build settings directly to use these names.

Window/Preferences/Java/Installed JREs
列出您计算机上安装的一个或多个 JDK。Eclipse 默认名称为 jdk1.X.X_XX,您应该保持原样。切勿直接链接项目构建设置以使用这些名称。

Window/Preferences/Java/Installed JREs/Execution Environments
List of common jvm environments such as JavaSE-1.6 and JavaSE-1-7 names. Click rows and choose jre instance on the right side panel. These names are common and all team members should already have them in Eclipse installation.

Window/Preferences/Java/Installed JREs/Execution Environments
常见 jvm 环境列表,例如 JavaSE-1.6 和 JavaSE-1-7 名称。单击行并在右侧面板上选择 jre 实例。这些名称是通用的,所有团队成员都应该已经在 Eclipse 安装中拥有它们。

Step 1: This is where you may accidentally have nothing chosen if JREs were uninstalled or names changed in InstalledJREs setting. You may get

第 1 步:如果卸载了 JRE 或在 InstalledJREs 设置中更改了名称,您可能会意外地没有选择任何内容。你可能会得到

Specified vm install not found error dialog.

未找到指定的 vm install 错误对话框。

Step 2: Choose 2nd mouse on build.xml file/Run As/Ant Build... popup menu entry. Click on JRE tab and choose execution environment. This may have obsolete value from the previous jdk values.

步骤 2:在 build.xml 文件/Run As/Ant Build... 弹出菜单项上选择第二个鼠标。单击 JRE 选项卡并选择执行环境。这可能与之前的 jdk 值相比具有过时的值。

Project Properties/Java Build Path/Libraries
Add Library.../JRE System Library/(x)Execution environment
Choose execution environment to be used for this project. Team members may not have exact _XX jdk build but they can use the same version controlled eclipse project settings. Execution environment mapping hides user specific details.

Project Properties/Java Build Path/Libraries
Add Library.../JRE System Library/(x)Execution environment
选择要用于此项目的执行环境。团队成员可能没有确切的 _XX jdk 构建,但他们可以使用相同的版本控制 eclipse 项目设置。执行环境映射隐藏了用户特定的详细信息。

回答by Bill Comer

Just had this issue & the solution above does not work, atleast not for me.

刚刚遇到这个问题,上面的解决方案不起作用,至少对我来说不是。

Instead I went the solution provided here:http://www.javaworkspace.com/VMNotFound.do

相反,我使用了此处提供的解决方案:http: //www.javaworkspace.com/VMNotFound.do

Essentially you go to the directory C:\projects\WORKSPACE.metadata.plugins\org.eclipse.debug.core.launches

基本上你去目录 C:\projects\WORKSPACE.metadata.plugins\org.eclipse.debug.core.launches

In there search for the string of the JDK that that eclipse is moaining about & change it to the name of your installed JDK that you want to use that eclipse knows about.

在那里搜索 Eclipse 正在抱怨的 JDK 字符串并将其更改为您要使用的 Eclipse 知道的已安装 JDK 的名称。

回答by Cheshiremoe

You can change what JRE the ant bulid file is launched with inside eclipse.

您可以更改在 eclipse 中启动 ant bulid 文件的 JRE。

Right click on the ant file in the ant view and select "Run As"->"Ant..." from the context menu.

在 ant 视图中右键单击 ant 文件,然后从上下文菜单中选择“Run As”->“Ant...”。

Then in the launch dialog select the JRE tab. Note the error message at the top if it can't find the JRE that it expects.

然后在启动对话框中选择 JRE 选项卡。如果找不到预期的 JRE,请注意顶部的错误消息。

Select a JRE that you have installed or manage install a new one. You can also add vm arguments (enable logging or change memory alocation) if you need to in this dialog.

选择您已安装的 JRE 或管理安装一个新的 JRE。如果需要,您还可以在此对话框中添加 vm 参数(启用日志记录或更改内存分配)。

回答by Kundan Atre

  1. Right Click on build.xml
  2. Go to "Run As" >> "External Tools Configurations..."
  3. It shall open new window
  4. Go to JRE tab
  5. Select proper JRE if missing (sometimes jre tabs shows error mark on that.)
  1. 右键单击 build.xml
  2. 转到“运行方式”>>“外部工具配置...”
  3. 它将打开新窗口
  4. 转到 JRE 选项卡
  5. 如果丢失,请选择正确的 JRE(有时 jre 选项卡会显示错误标记。)

For more technical details or issue similar to this find my blog here.

有关更多技术细节或与此类似的问题,请在此处找到我的博客。

回答by Shajee

The last answer is absolutely correct, however a fast track way is to delete the project reference from eclipse (make sure to keep unchecked delete source) and import your project folder again. This way the project configurations are reset by eclipse using the new jdk. But a wonderful post it did help me.

最后一个答案是绝对正确的,但是快速的方法是从 eclipse 中删除项目引用(确保保持未选中的删除源)并再次导入您的项目文件夹。通过这种方式,eclipse 使用新的 jdk 重置项目配置。但是一个很棒的帖子确实帮助了我。

回答by Sagar Vyas

In my case it happen as I have changed my JRE.

就我而言,这是因为我更改了 JRE。

Solution :

解决方案 :

Right click on your ant script > Run as > External tool configurations... > Go to JRE tab > select JRE

右键单击您的 ant 脚本 > 运行方式 > 外部工具配置... > 转到 JRE 选项卡 > 选择 JRE

Hope this help.

希望这有帮助。

Thanks, Sagar Vyas

谢谢,萨加尔维亚斯

回答by Sandeep Bhardwaj

Just delete the below file

只需删除以下文件

"<Your eclipse workspace location>\.metadata\.plugins\org.eclipse.debug.core\.launches\<projectname>.xml.launch"

link to post

发帖链接

回答by Amarjyoti Angan

After Java update ant build failed and the below steps fixed it .

Java更新蚂蚁构建失败后,以下步骤修复了它。

Right Click on build.xml-Run As-External Tools Go to JRE tab and check the box to use the JRE same as workspace.

右键单击 build.xml-Run As-External Tools 转到 JRE 选项卡并选中复选框以使用与工作区相同的 JRE。

回答by Chaitali Shah

Removed below file and build maven project again, worked for me.

删除了下面的文件并再次构建 maven 项目,对我有用。

.metadata.plugins\org.eclipse.debug.core.launches\.xml.launch"

.metadata.plugins\org.eclipse.debug.core.launches\.xml.launch"