Java-decompress and package Jar

Source: Internet
Author: User

Java-decompress and package Jar
Decompress and package Jar
Introduction1. Compressed package: Jar cvf filename. jar a. class B. class: compress the specified file; jar cvf weibosdkcore. jar *: compress all;
2. decompress the package: Jar xvf test. jar
Jar commandYesGenerate, view, update, and unlockThe role of the jar package, includingMETA-INF/MANIFEST. MFFile. It isJar packageAutomatically created when the jar package is generated.Main File LocationAndCurrent folder. Detailed description of jar command parameters:

C:\>jar cf lm.jar
The 'C' flag requires a list or input file! Usage:
jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...
Options include:-c create a new archive file-t list the archive directory-x decompress the archive specified (or all) file-u update existing archive file-v generate detailed output in standard output-f specify archive file name-m contain configuration information in the specified inventory file-e is bundled to the executable jar File the independent application specified application entry point-0 is stored only; do not use any ZIP compression-M do not create a project list file-I generate index information for the specified jar file-C change to the specified directory and contain the files if there is any directory file, then it is recursively processed. The order of configuration file name, archive file name, and entry name is the same as that of m, f, and e.
Jar cvf classes. jar Foo. class Bar. class
Jar cvfm classes. jar mymanifest-C foo /.
Executable Jar FileType lm. jar package.
C:\>jar cf lm.jar Lm.class Lm.java

C: \ jar> jar cvf lm. jar Lm. class
C: \> java-jar lm. jarFailed to load Main-Class manifest attribute from lm. jar according to the English error message, it seems that reading the manifest attribute of lm. jar package Failed.
C: \ jar> jar cvfM lm1.jar Lm. classAdded: Lm. class (read = 410) (write = 283) (compressed by 30%)
C: \ jar> jar tf lm. jarMETA-INF/The META-INF/MANIFEST. MFLm. class
C: \ jar> jar tf lm1.jarLm. class
C: \ jar> jar tvf lm. jar 0 Mon Sep 26 23:09:34 CST 2011 META-INF/75 Mon Sep 26 23:09:34 CST 2011 META-INF/MANIFEST. MF 410 Mon Sep 26 22:09:00 CST 2011 Lm. classThe detailed information includes the read bytes, the time when the jar package is read, the directory or file name.
C: \ jar> jar xf lm. jarNo information is displayed, but the decompression is successful.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.