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
JAR files work just like ZIP files. You can use any archive program to extract them. On Windows, you can Install WinRAR 7-Zip, or WinZIP. Macs have their own built-in archive program called Archive Utility.
jar -xvf /Directory/File.zip. -x extract named (or all) files from archive. -v generate verbose output on standard output. -f specify archive file name. Note: The 'jar' command extracts to the current directory.
To unpackage a JAR, you need a program that can extract compressed files. Windows includes functionality for this, but you can also use file extraction software like 7-Zip or WinRAR to get the job done. Open the JAR file within the software, and you can browse all the folders and files within it.
jars use zip compression so you can use any unzip utility.
Example:
$ unzip myJar.jar -d ./directoryToExtractTo
It's better to do this.
Navigate to the folder structure you require
Use the command
jar -xvf 'Path_to_ur_Jar_file'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With