JavaUser
JavaUser

Reputation: 26334

java/javac variation in PATH setting?

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

Answers (4)

Ryan Fernandes
Ryan Fernandes

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

keshav84
keshav84

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

Mike
Mike

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

Stephen C
Stephen C

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

Related Questions