无法启动 Eclipse -- 无法打开 \Java\jre6\lib\i386\jvm.cfg

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

Unable to start Eclipse -- can't open \Java\jre6\lib\i386\jvm.cfg

eclipsejava

提问by coder25

could not open C:\Program Files\Java\jre6\lib\i386\jvm.cfg

is the error coming when i am trying to start eclipse ide.

当我尝试启动 eclipse ide 时会出现错误吗?

my C:\Program Fileshas

C:\Program Files

jdk1.6.0_14
jdk1.6.0_17
jre6

folders.

文件夹。

path is set to

路径设置为

PATH: C:\Program Files\Java\jdk1.6.0_17\bin

what is the problem

问题是什么

i have seen this link but it is not solving my problem can't find JRE in the JDK

我已经看到这个链接,但它没有解决我的问题 在 JDK 中找不到 JRE

采纳答案by ric

I also had this problem and was having trouble finding a solution, but now I did!

我也遇到了这个问题并且很难找到解决方案,但现在我做到了!

If you uninstall your current running jre version and then install higher one you are good to go.

如果您卸载当前正在运行的 jre 版本,然后安装更高版本,您就可以开始了。

I was using jre1.6 when I had this problem but after installing 1.7 it was solved!

当我遇到这个问题时我正在使用 jre1.6,但在安装 1.7 后它解决了!

回答by Randle Sink

What worked for me was to go back to the Java webpage and download the Java jre instead of the jdk, since that is what the stupid computer is now looking for. Then open the C: Program Files>Java and make sure you see jre7 instead of jdk.

对我有用的是返回 Java 网页并下载 Java jre 而不是 jdk,因为那是愚蠢的计算机现在正在寻找的东西。然后打开 C: Program Files>Java 并确保您看到的是 jre7 而不是 jdk。

RS

RS

回答by Lars

This problem can show up if you initially install Java in the default location (C:\Program Files) and then later re-install into another location.

如果您最初将 Java 安装在默认位置 (C:\Program Files),然后稍后重新安装到另一个位置,则可能会出现此问题。

The default installation copies java.exe, javaw.exe and javaws.exe to C:\Windows\System32. If you are in this situation and delete these files it will likely solve your issue.

默认安装将 java.exe、javaw.exe 和 javaws.exe 复制到 C:\Windows\System32。如果您处于这种情况并删除这些文件,它可能会解决您的问题。

(Thanks to Jay: http://jaykhimani.blogspot.com/2012/09/error-could-not-open-cprogram.html)

(感谢 Jay:http: //jaykhimani.blogspot.com/2012/09/error-could-not-open-cprogram.html

回答by Josh

This is an old post, but what solved my solution was editing the `eclispe.ini' file to include the correct path to the JDK.

这是一篇旧帖子,但解决我的解决方案的是编辑“eclispe.ini”文件以包含 JDK 的正确路径。

Building off of what Lars answered, I did reinstall Java, so that may have been the source of the issue. Reglardless, this is the solution that worked for me. I did not have to delete any files from C:\windows\system32, however. I merely told eclipse to look in the new Java installation directory.

根据 Lars 的回答,我确实重新安装了 Java,因此这可能是问题的根源。无论如何,这是对我有用的解决方案。但是,我不必从 C:\windows\system32 中删除任何文件。我只是告诉 eclipse 在新的 Java 安装目录中查找。

These docsindicated I needed to specify the path to the VM:

这些文档表明我需要指定虚拟机的路径:

-vm
C:\Java\jdk1.7.0_25\bin\javaw.exe

回答by mycowan

I had similar problem on a Windows machine. I had moved my Java directory from inside "Program Files" (the space in the directory name was giving me trouble) over to c:\

我在 Windows 机器上遇到了类似的问题。我已经将我的 Java 目录从“Program Files”(目录名中的空格给我带来了麻烦)移到了 c:\

I set all my PATH variables to the new location, restarted the machine and thought that would be enough. Nope

我将所有 PATH 变量设置为新位置,重新启动机器并认为这就足够了。不

java -- version

java——版本

Error: could not open `C:\Program Files\Java\jre1.8.0_66\lib\i386\jvm.cfg

错误:无法打开`C:\Program Files\Java\jre1.8.0_66\lib\i386\jvm.cfg

This solution came from the good folks over at coderanch

这个解决方案来自 coderanch 的好人

Start regedit (just type "regedit" into the Run program) and work your way down to HKEY_LOCAL_MACHINE > SOFTWARE > JavaSoft

启动 regedit(只需在“运行”程序中输入“regedit”),然后依次进入 HKEY_LOCAL_MACHINE > SOFTWARE > JavaSoft

There you will find several different java directories

在那里你会发现几个不同的 java 目录

Java Development Kit

Java 开发工具包

Java Plug-in

Java插件

Java Runtime Environment

Java运行时环境

Java Update

Java 更新

Java Web Start

Java Web 入门

In each directory you'll find different directories for the different version of java (esp. Java Web Start). Open each and every one and you'll see that your old path is still listed. Double click the Name (left column) of the listing and manually type in the new path.

在每个目录中,您会找到不同版本的 java(特别是 Java Web Start)的不同目录。打开每一个,你会看到你的旧路径仍然被列出。双击列表的名称(左列)并手动输入新路径。

Open a new terminal and type in Java - version and you should be fine.

打开一个新终端并输入 Java - version ,你应该没问题。

回答by user7509146

Have a simpler solution:

有一个更简单的解决方案:

Check your PATH. Most likely it is referring to incorrect java.exe. This started happening to me when I installed OS patch. In process of checkpoint etc, PATH got modified. Once I corrected it (using Environment Variables...), it worked immediately.

检查您的路径。它很可能是指不正确的 java.exe。当我安装操作系统补丁时,这开始发生在我身上。在检查点等过程中,PATH 被修改。一旦我纠正了它(使用环境变量......),它立即起作用。

回答by Suraj Vaishnav

The problem is that your eclipse cant find jre.Just copy and paste your jre folder into eclipse folder and then start eclipse.Delete environment variable.

问题是你的eclipse找不到jre。只需将你的jre文件夹复制并粘贴到eclipse文件夹中,然后启动eclipse.Delete环境变量。

回答by user7898610

Problem: Eclipse Neon error: "C:\Program Files\Java\jre1.8.0xx.xx\jvm.cfg"

问题:Eclipse Neon 错误:“C:\Program Files\Java\jre1.8.0xx.xx\jvm.cfg”

Solution Win7 Pro: System Properties > Enviorment Variables > System Variables > Path > Edit > #make sure the current JAVA directory appears first in the path if more than 1 JAVA directory exist.

解决方案 Win7 Pro:系统属性 > 环境变量 > 系统变量 > 路径 > 编辑 > #如果存在多个 JAVA 目录,请确保当前 JAVA 目录首先出现在路径中。

In the path that follows, I moved "C:\ProgramData\Oracle\Java\javapath" behind the current directory "C:\Program Files\Java\jdk\bin;C:\Program Files\Java\jre\bin" > save

在接下来的路径中,我将“C:\ProgramData\Oracle\Java\javapath”移动到当前目录“C:\Program Files\Java\jdk\bin;C:\Program Files\Java\jre\bin”后面节省

Path C:\Program Files\Java\jdk\bin;C:\Program Files\Java\jre\bin;C:\apache-maven-3.5.0\bin;C:\ProgramData\Oracle\Java\javapath

路径 C:\Program Files\Java\jdk\bin;C:\Program Files\Java\jre\bin;C:\apache-maven-3.5.0\bin;C:\ProgramData\Oracle\Java\javapath

回答by pradeep

Try putting below line in your eclipse/STS -STS.ini file

尝试将以下行放在您的 eclipse/STS -STS.ini 文件中

-vm C:\Program Files\Java\jdk1.8.0_121(your JDK version)\bin\javaw.exe

-vm C:\Program Files\Java\jdk1.8.0_121(你的JDK版本)\bin\javaw.exe

Put it at the top of the file. Most probably it will work.

把它放在文件的顶部。很可能它会起作用。

Sometimes putting javaw.exe in eclipse folder also work (where eclipse.exe is there)

有时将 javaw.exe 放在 eclipse 文件夹中也可以工作(eclipse.exe 在那里)

回答by Rahul

This problem mainly occurs when we install new jre or jre gets updated automatically since jdk version and jre version are different and path variable i.e. JAVA_HOME contains jdk path with version included in it . Eclipse might be using that to generate the jre path name for the said file.

这个问题主要发生在我们安装新的 jre 或 jre 自动更新时,因为 jdk 版本和 jre 版本不同,路径变量即 JAVA_HOME 包含 jdk 路径,其中包含版本。Eclipse 可能会使用它来为上述文件生成 jre 路径名。

I did workaround i.e. changed name of jre folder to the older version e.g. jre1.8.0_191 is after installing update and jre1.8.0_60 was before update. I renamed jre1.8.0_191 with jre1.8.0_60 to solve the issue

我做了解决方法,即将 jre 文件夹的名称更改为旧版本,例如 jre1.8.0_191 是在安装更新之后,而 jre1.8.0_60 是在更新之前。我用 jre1.8.0_60 重命名 jre1.8.0_191 来解决这个问题