Reputation: 26334
In my windows machine , i can execute "java" without having PATH variable pointing to JDKs java.exe.But i am not able to run "javac" in the same way.Please tell me ,what could be the reason.
C:\Documents and Settings\USR1>java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)
C:\Documents and Settings\USR1>javac -version
'javac' is not recognized as an internal or external command,
operable program or batch file.
C:\Documents and Settings\USR1>echo %PATH%
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common
Files\Ahead\Lib\
Thx
Upvotes: 2
Views: 644
Reputation: 8526
when you install the JDK, the installer places a copy of java.exe in %WINDIR%\system32.
You will need to add %JAVA_HOME%\bin to your PATH if you need to compile or use any of the other goodies in that directory.
Upvotes: 1
Reputation: 2301
javac does not come with jre, check if the jre is somewhere there in the path variables, if so install jdk and set the bin location of jdk in the path variables.
Upvotes: 1
Reputation: 279
Sounds like there is an instance of java.exe in either your windows or windows\system directory. You can always search for all occurrences of java.exe.
Upvotes: 2
Reputation: 718796
Most strange. Are you sure you are not running a different "java.exe"? Try running "java -version" and "javac -version" with and without the PATH and see what is reported.
Upvotes: 0