execjar is a new CLI tool and Maven plugin that creates executable files from Java JAR files by prepending a shell launcher script to the JAR. Since JARs are ZIP files with their central directory at the end, a shell script can be prepended without corrupting the archive. The tool auto-generates a launcher script that finds a suitable JVM, honors version constraints, and sets environment variables. Benchmarks comparing execjar against GraalVM native-image show execjar builds ~100x faster and produces smaller binaries (4.8MB vs 31MB), while native-image executables run about 2x faster at startup. For long-running commands, the difference is negligible. The tool is UNIX-only and requires a fat JAR with all dependencies bundled.

11m read timeFrom mostlynerdless.de
Post cover image
Table of contents
IdeaBackgroundFeatures of execjarUsage of the Maven PluginUsage of the Command Line ToolBenchmark Comparison with Native-ImageConclusionAuthorRelated Posts:

Sort: