• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
nirjari patel
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

 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16059
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!