Reputation: 194
I am setting Environment Variable, Still OS cant recognise. Check this out you will get it.
https://www.dropbox.com/s/raqr4wbtoxxz0b8/1.JPG
I tried with Admin privileges also still same but when I enter
echo %java_home%
or
echo %jre_home%
It is showing path corretly. Why isnt javac command working.
Any Help will be appreciated.
Upvotes: 0
Views: 3101
Reputation: 1499810
You don't have javac
in your path. Setting the JAVA_HOME
and/or JRE_HOME
environment variables (which aren't needed any more, for the most part) does nothing to the PATH
which the command shell uses to find executables.
Put the relevant JDK bin
directory in your PATH
environment variable instead - and unless you actually need JRE_HOME
and JAVA_HOME
for some reason, I'd get rid of them. If you do need them, get rid of the "bin" part - it should just be the root JRE directory, e.g.
c:\Program Files\Java\jdk1.7.0_45
Upvotes: 4
Reputation: 3294
You must restart cmd
for new variables to be picked up. And java bin
folder needs to be included in path
. When you type javac
it goes through all folders defined in path
to find it.
Upvotes: 0
Reputation: 4962
Include the JRE/JDK path in System variables->PATH
as well
After adding path varaibles,restart the cmd
Upvotes: 0
Reputation: 887225
That has nothing to do with Java environment variables.
When you type javac
, or any other command, Windows will search the folders in the %PATH%
environment variable to find an EXE file with that name.
You need to add your JDK directory to %PATH%
.
You also need to restart cmd to pick up the changes.
Upvotes: 2
Reputation: 279880
Your path JAVA_HOME
should be, for example
C:\Program Files\Java\jdk.1.7.0_45
And your Path
variable should be
...;%JAVA_HOME%\bin
javac
is in the bin
folder which should be on your path.
Upvotes: 2