• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Where will JAR file be created when path is not provided

 
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
She still doesn't approve of my superhero lifestyle. Or this shameless plug:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic