📑 Table of Contents

The Java Packager tool is a tool included in the JDK which allows to package Java applications from the command line. It is an alternative to using other packaging tools like Apache Ant.[1]

Note that the Java Packager does not automatically produce a Jar file. Many other formats are available, including native executable formats for the platform.

The Java Packager tool also manipulates modules (added in Java 9), allowing for example to package a module and all the modules it depends on.[2]

Example

edit

For example, the following command will create a outputJar.jar file with the content of the classesDir directory, and will set the myPackager.MainClass as the executable class of the jar file:

javapackager -createjar -appclass myPackager.MainClass -srcdir classesDir -outdir out -outfile outputJar -v

References

edit
  1. ^ "The Java Packager Tool". Oracle Corporation. Retrieved 2017-07-31.
  2. ^ "JEP 275: Modular Java Application Packaging". Oracle Corporation. Retrieved 2017-07-31.
edit

📚 Artikel Terkait di Wikipedia

Java package

A Java package organizes Java classes into namespaces, providing a unique namespace for each type it contains. Classes in the same package can access each

Java Platform Module System

275: Modular Java Application Packaging: The Java packager will evolve for JDK 9, making it aware of modules, allowing for example to package a module and

Npm

npm is a package manager for the JavaScript programming language maintained by npm, Inc., a subsidiary of GitHub. npm is the default package manager for

Java (programming language)

(WORA), meaning that compiled Java code can run on all platforms that support Java without the need to recompile. Java applications are usually compiled

Java version history

The Java language has undergone several changes since JDK 1.0 as well as numerous additions of classes and packages to the standard library. Since J2SE 1

Package

Packager (disambiguation) Packaging (disambiguation) Packet (disambiguation) PKG (disambiguation) Software package (disambiguation) Surprise Package (disambiguation)

List of Java APIs

Oracle), MicroEJ. These packages (java.* packages) are the core Java language packages, meaning that programmers using the Java language had to use them

Java annotation

parameters and Java packages may be annotated. Like Javadoc tags, Java annotations can be read from source files. Unlike Javadoc tags, Java annotations can