File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Jar command Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Jar command " Watch "Jar command " New topic

Jar command

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
I want to extract a war file into a specific folder, which option I should use ?

This doesn't work : jar xvf my.war -d newFolder

Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

JAR command doesn't have -d option. You may want to use another command, such as unzip, e.g.

If you insist of using a JAR command, what you can do is to create a shell script that create a directory and move the jar file into that directory and do the extraction from there.

Hope it helps.

SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Jar command
It's not a secret anymore!