aspose file tools*
The moose likes Beginning Java and the fly likes javac not recognized as an internal or external command Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "javac not recognized as an internal or external command" Watch "javac not recognized as an internal or external command" New topic
Author

javac not recognized as an internal or external command

deepa karra
Ranch Hand

Joined: Apr 04, 2008
Posts: 46
I installed jdk 1.6.0_16 version and set the class path to c:\program files\java\jdk1.6.0_16\bin.
When i compiled the program, i got an error javac is not recognized as an internal or external command,operable program or batch program.
Do i need to save the programs inside jdk?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19760
    
  20

You shouldn't have set the class path to that folder, but added that folder to your PATH variable instead. And I do mean added; the last thing you want is to replace your PATH by only Java.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39828
    
  28
He probably hasn't replaced the entire PATH by the Java installation folder, otherwise he would lose access to the Windows folder and all sorts of things would fail to run

There is a section in the Java™ Tutorials which addresses that error.
deepa karra
Ranch Hand

Joined: Apr 04, 2008
Posts: 46
sorry it was not to the class path i added, I added it to the path.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39828
    
  28
Did you open a new command prompt window? The new PATH is only implemented in new command windows.

If that doesn't help:

I'm not running Windows at the moment, so I can't check the syntax, but try
echo %PATH% or echo $PATH or %PATH% or $PATH and see whether any of those gives the contents of your PATH. Check whether there are any spelling errors and that the path entries are separated by ; correctly.
deepa karra
Ranch Hand

Joined: Apr 04, 2008
Posts: 46
I checked the path again. The error was due to a single blank space in the path
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39828
    
  28
Well done sorting it out
 
Consider Paul's rocket mass heater.
 
subject: javac not recognized as an internal or external command