'Java' is not recognized as an internal or external command
You need to configure your environment variables,
JAVA_HOME must contain the path to java, and you should add %JAVA_HOME%\bin to
Alternatively, you can simply add to your
PATH the whole path to the bin folder, without the
JAVA_HOME variable, however, this makes a little more annoying when you need to have more than one java version on your machine (that way you only need to change
JAVA_HOME and don't even bother with
For Windows 7:
- Right click on
Advanced System Settings
- Click on
In Variable value editor paste this at the start of the line
Click Ok then Ok again
- Restart command prompt otherwise it won't see the change to the path variable
java -versionin command prompt.
Notes on Step 8:
1. The version of java in this may be different from the one used here -- this is only an example.
2. There will probably be other values in the path variable. It is really important that you don't delete what's already there. That's why the instructions say to paste the given value at the start of the line -- this means that you don't remove the existing value, you just put java before it. This also fixes any problems you'd be getting if an other version of java is also on the path.
Notes on Step 6:
1. This sets the path for the computer, not for the individual user. It may be that you're working on a computer which other developers also use, in which case you'd rather set the user variables, rather than the system variables
It sounds like you haven't added the right directory to your path.
First find out which directory you've installed Java in. For example, on my box it's in
C:\Program Files\java\jdk1.7.0_111. Once you've found it, try running it directly. For example:
c:\> "c:\Program Files\java\jdk1.7.0_11\bin\java" -version
Once you've definitely got the right version, add the
bin directory to your
PATH environment variable.
Note that you don't need a
JAVA_HOME environment variable, and haven't for some time. Some tools may use it - and if you're using one of those, then sure, set it - but if you're just using (say) Eclipse and the command-line
javac tools, you're fine without it.
1 Yes, this has reminded me that I need to update...