JEP 311: Java Packager API & CLI

OwnerVictor Drozdov
StatusClosed / Withdrawn
Componentdeploy / packager
Discussionjdk dash dev at openjdk dot java dot net
Relates toJEP 343: Packaging Tool (Incubator)
Reviewed byChris Bensen, Kevin Rushforth
Endorsed byKevin Rushforth
Created2017/04/11 16:07
Updated2018/04/05 20:22


Create a new, long-term API and CLI for the Java Packager.


The Java Packager API is not currently documented or supported. It is used by build tools such as ant-javafx.jar, and by Gradle and Maven plugins. Currently they use an API that is located in the packages:

The API is far too broad. It should be more consistent with the platform, and no longer export com.sun.* or* packages. These are all deprecated in JDK 10 and will be removed in JDK 11. All package names should share a common prefix. Every option should be available via the CLI.

The current Java Packager CLI is not intuitive, not consistent with other Java tools, and not all features are accessible. The Java Packager needs to provide a new CLI that exposes all features, and is available via a ToolProvider.


ant-javafx.jar will be deprecated, and replaced with ant-java.jar, which uses the new ToolProvider API and and changes all scopes from "fx" to "packager". The Java Packager will be accessible by a ToolProvider in a manner similar to the javac compiler and the jdeps tool. Java Web Start support(JNLP files) will be removed in the new CLI.

CLI arguments

For backward compatibility, existing CLI arguments will be left as-is for JDK 10, and refactored into a method that can be removed later.

The CLI will be reworked to be simpler and expose all Java Packager features. Argument syntax will be more robust, and support one of four options:

-name value
--name value

New CLI arguments

NOTE: This is just a preliminary list of arguments.

These are the first order arguments that determine what the operation that the Java Packager will be performing:



-outdir <directory>
--strip-native-commands <true/false>
-jvmargs <name,value>(:<name,value>)*
-jvmuserargs <name,value>(:<name,value>)*
-mac.file.associations <extension,"description">(:<extension,"description">)*
-default-arguments <value>(:<value>)*


-file.associations <extension,"description">(:<extension,"description">)*

Configuration-file support

There will be support similar to java.exe, to pass all arguments via a configuration file. This will be a properties file.