• 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

Where will JAR file be created when path is not provided  RSS feed

 
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) C:\Users\nirjari>"C:\Program Files\Java\jdk1.7.0_79\bin\jar" cf "C:\Users\nirjari\Desktop\Java\CustomerSource" "C:\Users\nirjari\Desktop\JAR\CustomerSource\buildJar.xml"

When I am executing command as above, I can see CustomerSource jar is created on desktop under JAVA folder.

C:\Users\nirjari>"C:\Program Files\Java\jdk1.7.0_79\bin\jar" cf CustomerSource "C:\Users\nirjari\Desktop\JAR\CustomerSource\buildJar.xml"
Where will CustomerSource be created, if I dont provide path. Wha is default location ? I dont see this JAR created in same location as buildJar.xml.
Is there a way to check, where a file is created when path is not provided ?

2) C:\Program Files\Java\jdk1.7.0_79\bin\jar , I have included this path in PATH variable. But still when I run jar cmd, I am getting error message "'jar' is not recognized as an internal or external command, operable program or batch file." , why is that

Thanks

 
Java Cowboy
Posts: 16084
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It will be created in the current directory, which is C:\Users\nirjari as I can see in your command.

nirjari patel wrote:2) C:\Program Files\Java\jdk1.7.0_79\bin\jar , I have included this path in PATH variable. But still when I run jar cmd, I am getting error message "'jar' is not recognized as an internal or external command, operable program or batch file." , why is that


You should put the directory that contains jar.exe in the PATH, not jar itself. Put this in the path: C:\Program Files\Java\jdk1.7.0_79\bin instead of C:\Program Files\Java\jdk1.7.0_79\bin\jar
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!