Setting JAVA_HOME

Tags: , ,



I’m having a problem when running programs that use Java from the command line. I get back a message saying Java.exe could not be found.

enter image description here

I’ve followed the instructions found in several places for setting JAVA_HOME in Windows 7.

enter image description here

As can be seen in the image I’m pointing to the JDK folder as instructed, I’ve also tried several variations including linking to the bin folder(where java.exe is located).

What am I doing wrong, and how can I debug this.

EDIT:

Typing Set in Command Prompt outputs

enter image description here

Answer

As many have mentioned I had to add…

C:Program FilesJavajdk_versionbin

…to the path variable.

However what was not mentioned and was stopping this from working was that I had to make sure javabin directory is in the path statement before the windowssystem32 directory, otherwise this will not work.

I was able to find the information here.



Source: stackoverflow