views:

51

answers:

4

Hi,

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

A: 

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.

Stephen C
+1  A: 

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.

Mike
Yes ,you are right ..how "java" came there in System32 folder and why nt "javac"
JavaUser
Some application probably put it there during installation -- one that needs the JVM to run.
Chris Dennett
Well it's probably there for running java applets and stuff for your browser or something. Java.exe is required to run a java application so it comes with the Java Runtime Environment that a java based application will install. You only get the compiler (javac) with the development kit because it's not needed for the vast majority of people who run java apps but do not write them.
Mike
+1  A: 

Hi,
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.

keshav.veerapaneni
+1  A: 

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.

Ryan Fernandes