• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

javac not recognized as an internal or external command  RSS feed

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Sheriff
Posts: 21745
102
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 64494
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry it was not to the class path i added, I added it to the path.
 
Campbell Ritchie
Marshal
Posts: 64494
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I checked the path again. The error was due to a single blank space in the path
 
Campbell Ritchie
Marshal
Posts: 64494
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done sorting it out
 
He baked a muffin that stole my car! And this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!