Extracting jar to specified directory

Andna picture Andna · Apr 5, 2013 · Viewed 122.6k times · Source

I wanted to extract one of my jars to specified directory using jar command line utility.

If I understand this right -C option should to the trick but when I try

jar xvf myJar.jar -C ./directoryToExtractTo

I am getting usage information from my jar utility, so I am doing something wrong.

Is the thing I want achievable with jar or do I need to manually move my jar and there invoke

jar xvf myJar.jar

Answer

Amit Maniar picture Amit Maniar · Apr 5, 2013

jars use zip compression so you can use any unzip utility.

Example:

$ unzip myJar.jar -d ./directoryToExtractTo