CLI Commands

Complete reference for jbundle command-line interface.

jbundle build

Build a self-contained binary from a JVM project or JAR.

jbundle build [OPTIONS] --input <PATH> --output <PATH>

Required Arguments

Argument
Description

--input <PATH>

Project directory or JAR file

--output <PATH>

Output binary path

Options

Option
Default
Description

--java-version <N>

21

JDK version to bundle (11, 17, 21, 22, 23, 24, 25)

--target <TARGET>

current

Target platform (see Platforms)

--profile <PROFILE>

server

JVM profile (cli or server)

--jvm-args <ARGS>

JVM arguments (e.g., -Xmx512m)

--build-args <ARGS>

Extra arguments passed to the build tool (e.g., Gradle -P flags)

--shrink [true|false]

false

Shrink uberjar by removing non-essential files

--no-appcds

Disable AppCDS generation

--crac

Enable CRaC checkpoint (Linux only)

--compact-banner

Use a compact banner in the wrapper

--gradle-project <NAME>

Gradle subproject to build (multi-project)

--all

Build all application subprojects (Gradle)

--modules <LIST>

Manual module list, comma-separated

--java-home <PATH>

Path to existing JDK installation (skips JDK download). Falls back to JAVA_HOME env var.

--jlink-runtime <PATH>

Path to existing jlink runtime to reuse (must contain bin/java)

--dry-run

Show build plan without executing anything

-v, --verbose

Enable verbose output

Examples

jbundle analyze

Analyze a JAR or project and report size breakdown, top dependencies, and potential issues.

Options

Option
Default
Description

--input <PATH>

.

Project directory or pre-built JAR file

When given a project directory, jbundle detects the build system, builds the uberjar, then analyzes it. When given a JAR file directly, it skips the build step.

Output

The report includes:

  • Category breakdown — Classes, Resources, Native libs, Metadata, Clojure/Java sources with size and file count

  • Top packages by size — Grouped by first 3 path segments (e.g., org.apache.commons)

  • Clojure namespaces — Detected from __init.class entries

  • Shrink estimate — How much --shrink would save

  • Potential issues — Duplicate classes, large resources (> 1 MB)

Examples

jbundle info

Display cache information.

Shows:

  • Cached JDK downloads

  • Extracted runtimes

  • Application caches

  • Total cache size

jbundle clean

Remove all cached data.

Removes everything in ~/.jbundle/cache/.

jbundle --version

Print version information.

jbundle --help

Print help message.

Exit Codes

Code
Meaning

0

Success

1

Build error (compilation failed, JAR not found, etc.)

2

Configuration error (invalid arguments, missing input)

Environment Variables

Variable
Description

JAVA_HOME

Path to existing JDK installation (used when --java-home is not specified)

RUST_LOG

Logging level (error, warn, info, debug, trace)

Logging Examples

Last updated

Was this helpful?