Is there a way to extract a jar file to a specific directory? For instance, I'm in foo directory, which contains the subfolder bar; all my jars files are at the same level at bar. So I passed the command jar xf my.jar -C bar/
However when I went to bar folder, the files were not extracted. Is there a way for me to do it without having to move the jar file to bar?
Thanks
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.
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.
I don't think jar
supports this, but unzip
does. Try:
unzip my.jar -d bar
The behaviour is the same as the jar
command, because jar files are the same as zip files.
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