• 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

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

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your path variable controls where the system will search for commands. What is your path set to?
 
Ranch Hand
Posts: 704
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx for the replying.
It works well after setting the path variable.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
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
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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 2236
63
IntelliJ IDE Firefox Browser Spring Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Someone may find what i said helpful though...
 
My name is Inigo Montoya, you killed my father, prepare to read a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic