Java: System cannot find the file C:\\ … java.exe

时光怂恿深爱的人放手 提交于 2019-12-09 04:12:28

Just set %JAVA_HOME%/bin to your path variable.

1.Just go to C:\ProgramData\Oracle\Java\javapath\

2.You will find there shortcuts for java.exe,javaw.exe,javaws.exe which are pointing to a location where they actually are not existing now

3.Go to the jre location where you have installed java like C:\Program Files\Java\jre6\bin

  1. You will find java.exe,javaw.exe,javaws.exe

  2. Create shortcuts for these files and replace with the ones which are present in C:\ProgramData\Oracle\Java\javapath.

It works

rni902

I was able to solve this issue. To do so I used the advice from this answer:

Java SE Development Kit 8u25 on a 64-bit Windows 8

Set the following user environment variables (== environment variables of type user variables)

•JAVA_HOME : C:\Program Files\Java\jdk1.8.0_25
•JDK_HOME  : %JAVA_HOME%
•JRE_HOME  : %JAVA_HOME%\jre
•CLASSPATH : .;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib
•PATH      : your-unique-entries;%JAVA_HOME%\bin 

(make sure that the longish your-unique-entries does not contain any other references to another Java installation folder.)

If you are blocked from modifying system variables from command line, but are able to open up an elevated command prompt, then run a command like this:

setx \M JAVA_HOME "C:\Program Files\Java\jdk1.8.0_25"

But of course, change the directory to point to your installed version of java. Note that the JAVA_HOME path does not point into the bin directory, it stops one level above bin.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!