• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

'javac' is not recognized as an internal or external command, operable program or batch file.

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using jdk1.6.0_22 . and I have set path variable to C:\Program Files\Java\jdk1.6.0_22\bin but when i am trying to compile any java program written anywhere then it shows me the error as follows............

D:\SCJPPR~1\7_GENE~1>javac TestSort1.java
'javac' is not recognized as an internal or external command,
operable program or batch file.


Please help me how can i solve this error?

Thanks in advance.
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Once you have set the environment variables - You need to re enter the command prompt. Did you try that? And how did you set your PATH variable value?
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
on a command prompt you can type

echo %path%

and see what that window's current path is - make sure it includes the correct path to the java bin.
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According the value you wrote, the path value is correct but I will advice you to do these checks.
Depending on who you set the path:

I am assuming that you run windows
If you have set it permanently on your machine in the environment variable, the confirm that there is a ";" separating any path preceding the one you just set.

Again open the command prompt and type echo %path%
You should get a list all the items in your path (each separated with ;) including the path to your JDK.

Else, open a new Command Prompt and type:
set path=
set path=thePathToYourJDK_JustAsYouIndicatedAbove
 
Jay Nisha
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

mohamed sanaullah wrote:Once you have set the environment variables - You need to re enter the command prompt. Did you try that? And how did you set your PATH variable value?





Thanks Mohamed,
Your solution works.Actually I hadn't re enter the command prompt after setting environment variables.
Thanks for replying me n giving solution.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
im using jdk 1.6.0 after i set the path, in command prompt its showing an error like 'javac' is not found as an internal or external command, operable program or batch file
please help me to solve this problem:(
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nandu Nandini wrote:hi,
im using jdk 1.6.0 after i set the path, in command prompt its showing an error like 'javac' is not found as an internal or external command, operable program or batch file
please help me to solve this problem:(



Considering that you posted to a two year old topic -- can we assume that you tried the suggestions in this topic and failed? And if so, can you tell us the details of what happened when you tried them?

Henry
 
Nandu Nandini
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ya i followed given suggesions but i am not able to compile program, if i enter javac to compile in command prompt its showing an error like 'javac' is not found as an internal or external command, operable program or batch file
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch
Did you open a new command line? The new PATH is not applied to the old command window.
How have you set your PATH environment variable? Please execute echo %PATH% and show us the output.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is path from cmd
path.PNG
[Thumbnail for path.PNG]
path
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Those screenshots are illegible. Please post real text.
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch
Please don’t add new questions to an old thread; fortunately I can split off your question to a new thread.
Which environment variable is that? Why does it have so many components in? Does %JAVA_HOME% and with \?
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
zira ramli,
Your post was moved to a new topic.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic