A self-contained launcher for Java applications, providing @argfile
support.
- Some use cases for Java tools require passing a large command line, which can reach the size limit on Windows (or even on Linux). There are workarounds in some scenarios (e.g. using classpath jars, or built-in
@argfile
support), but not in general. - In some build systems (e.g. SBT), using tools from another JVM is more difficult than running
java
orjavac
.
- Supports launching main classes.
- Supports launching
ToolProvider
tools (requires JVM 9 or higher). - Supports
@argfile
s.
Launch a main class:
$ java -cp my-app.jar -jar tool-launcher.jar -main my.App <args>
Launch a Java tool:
$ java -jar tool-launcher.jar -tool jdeps my-app.jar
Expand an @argfile
:
$ java -jar tool-launcher.jar -tool jdeps @my-args.txt
Escape an argument starting with @
(for bash - this depends on your shell):
$ java -jar tool-launcher.jar -tool javac '\@foo'
- JVM 8+ for running;
- JVM 9+ for
ToolProvider
support; - JVM 11+ for building.
- This is versioned via sbt-dynver.
- This is published to Sonatype - you would need to set up your environment as described here