Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Jay Nisha
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • 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.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • 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?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12200
35
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • 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.
 
Paul Okeke
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Nandu Nandini
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
 
Henry Wong
author
Marshal
Pie
Posts: 21506
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Campbell Ritchie
Sheriff
Pie
Posts: 50251
79
  • Mark post as helpful
  • send pies
  • 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.
 
zira ramli
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is path from cmd
path.PNG
[Thumbnail for path.PNG]
path
 
Campbell Ritchie
Sheriff
Pie
Posts: 50251
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Those screenshots are illegible. Please post real text.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50251
79
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Pie
Posts: 50251
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
zira ramli,
Your post was moved to a new topic.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic