简体   繁体   English

Eclipse无法找到javaw.exe

[英]Eclipse cannot find javaw.exe

When i start eclipse i get this problem: 当我开始eclipse时,我遇到了这个问题:

在此输入图像描述

The location of javaw.exe in my computer is C:\\Program Files\\Java\\jre7\\bin. 我的计算机中javaw.exe的位置是C:\\ Program Files \\ Java \\ jre7 \\ bin。 I have tried change the path environment variable then i get different error like: 我试过更改路径环境变量然后我得到不同的错误,如:

在此输入图像描述

Following the comment of @nitind, I've checked the bit depth of my Eclipse and of the installed Java. 在@nitind的评论之后,我检查了我的Eclipse和已安装的Java的位深度。 It turned out that, apparently, during the recent update the Java installer has deleted the old 64 bit installation (so program files/java/jre7/ became empty. After downloading the 64 bit version manually (from http://www.java.com/en/download/manual.jsp ), I'm now able to run Eclipse again. 事实证明,显然,在最近的更新期间,Java安装程序删除了旧的64位安装(因此程序文件/ java / jre7 /变为空。手动下载64位版本后(来自http://www.java)。 com / en / download / manual.jsp ),我现在能够再次运行Eclipse。

Also got this Eclipse open refusal bug now after the JRE was updated to jre1.8.0_111. 在JRE更新为jre1.8.0_111之后,现在也得到了这个Eclipse公开拒绝错误。

For some reason it was trying to find a jre1.8.0_101/bin/javaw.exe instead of the jre1.8.0_111/bin/javaw.exe file . 出于某种原因,它试图找到jre1.8.0_101 / bin / javaw.exe而不是jre1.8.0_111 / bin / javaw.exe文件。 . .

Solution was to go to the eclipse Configuration Settings file and then change 解决方案是转到eclipse配置设置文件然后更改

-vm
C:/Program Files/Java/jre1.8.0_101/bin/javaw.exe

to

-vm
C:/Program Files/Java/jre1.8.0_111/bin/javaw.exe

Why was the virtual machine pointed at a file called 为什么虚拟机指向一个名为的文件

jre1.8.0_101/bin/javaw.exe

in the first place ? 首先?

Search me but I don't know ! 搜索我,但我不知道!

Try starting your eclipse.ini (in the same directory with eclipse.exe) with the two lines: 尝试使用以下两行启动eclipse.ini(与eclipse.exe位于同一目录中):

-vm
C:/Program Files/Java/jre7/bin/javaw.exe

JAVA_HOME should be left as it was before, eg c:\\Program Files\\Java\\jdk1.7.0 , and %JAVA_HOME%\\bin should be added to the PATH variable, so all required files are available in the environment. JAVA_HOME应保持原样,例如c:\\Program Files\\Java\\jdk1.7.0%JAVA_HOME%\\bin应添加到PATH变量中,因此环境中可以使用所有必需的文件。

That should be all you need to run Eclipse. 这应该是运行Eclipse所需的全部内容。 If you'd like to specify a diferent vm, take a look at http://wiki.eclipse.org/Eclipse.ini 如果您想指定不同的虚拟机,请查看http://wiki.eclipse.org/Eclipse.ini

If you updated your JRE as did I, eclipse will send the same error report. 如果您像我一样更新了JRE,eclipse将发送相同的错误报告。 To correct this issue I went into the eclipse path (ie) path\\eclipse\\jee-mars\\eclipse and updated the "eclipse configuration-setting" file. 为了纠正这个问题,我进入了eclipse路径(即)path \\ eclipse \\ jee-mars \\ eclipse并更新了“eclipse配置设置”文件。

Open the file in some form of editior, I used notepad++. 用某种形式的editior打开文件,我用了notepad ++。 Update the version of JRE on this line..."C:\\Program Files\\Java\\jre1.8.0_91\\bin" save the file and start eclipse. 更新此行上的JRE版本...“C:\\ Program Files \\ Java \\ jre1.8.0_91 \\ bin”保存文件并启动eclipse。

i was faced this issue because my JAVA_HOME is not there in the system environment, path variable don't have the java related info. 我遇到了这个问题,因为我的JAVA_HOME不在系统环境中,路径变量没有java相关信息。

so go to the elipse folder and edited the "eclipse.ini" file with below lines after "openFile" line 所以转到elipse文件夹并在“openFile”行之后用下面的行编辑“eclipse.ini”文件

-vm C:\\Program Files\\Java\\jdk1.8.0_144\\bin\\javaw.exe -vm C:\\ Program Files \\ Java \\ jdk1.8.0_144 \\ bin \\ javaw.exe

it solves my issue. 它解决了我的问题。

Since it has told you that it was looking in D:\\Eclipse\\jre\\bin\\ for javaw.exe go to C: <- your computer look in program files or else where for java. 因为它告诉你它正在寻找D:\\ Eclipse \\ jre \\ bin \\ for javaw.exe转到C:< - 你的计算机在程序文件中查找或者在java中查找。 java will contain a file that has a jre\\bin\\ and you will find javaw.exe copy the contents of bin to D:\\Eclipse\\jre\\bin\\ and you are set. java将包含一个具有jre \\ bin \\的文件,你会发现javaw.exe将bin的内容复制到D:\\ Eclipse \\ jre \\ bin \\并且你已经设置好了。

alternatively copy the the jre file inside the java folder and replace the jre file in the Eclipse folder and you are set. 或者将jre文件复制到java文件夹中并替换Eclipse文件夹中的jre文件并进行设置。

Now the above (first) solution works but is bad practice. 现在上述(第一)解决方案有效,但是做法不好。

Good practice is to have your jre folder set in your path variables. 好的做法是在路径变量中设置jre文件夹。

所以对于像我这样的任何完整的noob将java开发工具包(JDK)移动到eclipse文件夹并将其重命名为jre

JAVA_HOME should be added like c:\\Program Files\\Java\\jdk1.7.0 , and %JAVA_HOME%\\bin should be added to the PATH variable. 应该像c:\\ Program Files \\ Java \\ jdk1.7.0一样添加JAVA_HOME ,并且应该将%JAVA_HOME%\\bin添加到PATH变量中。 Then it works without issues. 然后它没有问题。

Please map correctly java path in environment varibales like below. 请在环境varibales中正确映射java路径,如下所示。 it will be resolved. 它会得到解决。 Path=C:\\Program Files\\Java\\jdk1.6.0_16\\bin; Path = C:\\ Program Files \\ Java \\ jdk1.6.0_16 \\ bin;

For sure it will be resolved 肯定会得到解决

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM