• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

'jar' is not recognized as an internal or external command

 
Priya Lavti
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
after installing j2sdk1.4.2, when i try to give the command jar -? or javac -? from outside the bin directory of javahome, Error ocurrs as "'jar' is not recognized as an internal or external command, operable program or batch file."
The class path set is CLASSPATH=D:\j2sdk1.4.2\bin;D:\j2sdk1.4.2\lib;D:\j2sdk1.4.2\jre

Strange behavior is that while giving java -? from outside the bin directory, it executes properly and displays the help of java command.

Looking forward for the reply
thanx in advance
 
Mike Gershman
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your path variable controls where the system will search for commands. What is your path set to?
 
Nigel Browne
Ranch Hand
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your PATH variable must include the the path to the bin directory of your SDK. So in your case
 
Priya Lavti
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx for the replying.
It works well after setting the path variable.
 
John McClellan
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I saw this thread and wanted to ask real quick how you might be able to find that path if you don't know exactly what version the SDK is. Thanks!
 
fred rosenberger
lowercase baba
Bartender
Posts: 12143
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what OS are you using? On windows, i'd just look around using windows explorer.

you can also try "javac -version" to find what version you have, which may give you some clues. or you can use windows 'search' function to, well, search for it.
 
John McClellan
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used the command you mentioned and found that the version was 1.6.0_22, so I went to the C:\ directory and ran a Windows search for j2sdk1.6.0_22, but it didn't come up with anything. Sometimes the Windows search engine misses things. What else can I do to find it?
 
John McClellan
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apparently the directory that I needed to find was jdk1.7.0\bin for some reason. Thanks for your help!
 
duc nguyen hoang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JAVA_HOME is not resolved. Instead of using %JAVA_HOME% in your path system variable, change it to explicit jdk path and restart your command prompt
 
Paweł Baczyński
Bartender
Posts: 1796
33
Firefox Browser IntelliJ IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A call from the grave!
PS. Nobody said anything about JAVA_HOME in this thread...
 
duc nguyen hoang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Someone may find what i said helpful though...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic