Details
Description
jlink --launcher <name>=<module>[/<mainclass>] creates a launcher for the specified module/main class.
JDK 9 creates a script to run java -m <module>[/<mainclass>]. An enhancement is to create a native launcher to replace the script.
One idea is to have a prebuilt a tool launcher executable that reads a @argfile for the application. For example, jlink --launcher foo=org.foo/org.foo.Main
This will create a launcher $java.home/bin/foo and $java.home/bin/.foo_argfile
where .foo_argfile contains the VM options and -m org.foo/org.foo.Main.
Another alternative Jon suggests is to have the tool launcher to read from a static char array that will be patched by jlink to include the VM options plus the module/mainclass information.
The challenge would be for cross-platform linking and also ensure the prebuilt tool launcher executable supports the version of the target platform (likely that this executable may need to be copied from java.base.jmod)
JDK 9 creates a script to run java -m <module>[/<mainclass>]. An enhancement is to create a native launcher to replace the script.
One idea is to have a prebuilt a tool launcher executable that reads a @argfile for the application. For example, jlink --launcher foo=org.foo/org.foo.Main
This will create a launcher $java.home/bin/foo and $java.home/bin/.foo_argfile
where .foo_argfile contains the VM options and -m org.foo/org.foo.Main.
Another alternative Jon suggests is to have the tool launcher to read from a static char array that will be patched by jlink to include the VM options plus the module/mainclass information.
The challenge would be for cross-platform linking and also ensure the prebuilt tool launcher executable supports the version of the target platform (likely that this executable may need to be copied from java.base.jmod)
Attachments
Issue Links
- relates to
-
JDK-8220700 jlink generated launcher script needs quoting to avoid parameter expansion
-
- Resolved
-