Jar package and jar package command

Source: Internet
Author: User

Jar package and jar package command
Jar is a standard java packaging command, which is located under the JAVA_HOME/bin/directory. The main function is to package multiple files into a separate jar file.

  • Create a jar File
Jar c [v0Mmfe] [manifest] [jarfile] [entrypoint] [-C dir] inputfiles [-Joption]
  • Update jar files
Jar u [v0Mmfe] [manifest] [jarfile] [entrypoint] [-C dir] inputfiles [-Joption]
  • Decompress the jar File
Jar x [vf] [jarfile] [inputfiles] [-Joption]
  • Show Jar package structure
Jar t [vf] [jarfile] [inputfiles] [-Joption]
  • Add an index to a jar file
Jar I jarfile [-Joption] [] indicates the optional parameter: jarfile: The target jar File Created, updated, decompressed, or displayed. inputfiles: file or directory is used together with the-f option, multiple files or directories are separated by spaces, indicating the files or directories to be packaged, the files or directories in the jar package to be decompressed, and the files or directories of the jar package to be displayed. If it is a directory, it will be processed recursively. Multiple files are compressed in zip mode, unless you add the 0 option manifest: Specify the manifest file, and use entrypoint with the-m parameter: Specify the class name as the application entry, used with the-e option. In particular, the order of manifest, jarfile, and entrypoint corresponding to the-m,-f, and-e parameters must be the same-C dir: Specifies the inputfile directory after processing inputfiles, you can have multiple-C dir inputfile-Joption: Specifies the Java runtiome environment parameter.-J and option cannot have space options: c create new jar package u update existing jar package x decompress specified jar package t display jar package content f and jarfile together use v output details 0 do not use zip compression M to generate jar when creating a package, do not create a manifest file. m and manifest are used together with e and entrypoint, specifies the entry Class of the program and writes it to the generated manifest file, corresponding to Main-Class. If the package is used with manifest and the manifest name is Main-Class, an error occurs.

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.