javamc
A tiny cross-platform CLI for downloading and running the official Java runtimes
that Mojang ships with Minecraft. It fetches Mojang's Java runtime manifest,
installs the runtime matching your OS and architecture, and can hand off
execution to the downloaded java binary — useful for launching Minecraft
servers or clients with the exact JRE Mojang intends.
Features
- List every Java runtime Mojang publishes for your platform
- Download a specific runtime into a directory of your choice
- Auto-download (if missing) and execute a runtime, forwarding any extra args
straight through to
java - Live download progress (percent, file count, MB/s)
- Picks the correct runtime for your OS/arch automatically (Windows x86/x64, macOS x64/arm64, Linux x64/i386)
Installation
This installs the javamc binary onto your PATH.
Usage
List available versions
Prints each runtime available for your platform with its release date:
Available Java versions:
java-runtime-delta (2024-04-01)
java-runtime-gamma (2023-05-12)
...
Download a runtime
Example:
Downloads the named runtime into ./jre, showing progress as it goes.
Download and execute
If the runtime isn't already present in <DIRECTORY>, it is downloaded first.
Everything after the directory is forwarded verbatim to the java executable.
stdio and the working directory are inherited, so it behaves exactly like
running java directly.
Example — launch a Minecraft server:
The process exits with the same status code that java returns.
How it works
javamc queries Mojang's Java runtime manifest,
selects the bundle for your current OS and architecture at compile time, and
installs it with up to 100 concurrent downloads. Version resolution and
downloads are powered by the piston-mc
crate.
License
See the repository for license details.