javamc 0.1.0

Cross-platform CLI to download and run the official Mojang Java runtimes bundled with Minecraft.
javamc-0.1.0 is not a library.

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

cargo install javamc

This installs the javamc binary onto your PATH.

Usage

javamc <COMMAND>

List available versions

javamc list

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

javamc download <VERSION> <DIRECTORY>

Example:

javamc download java-runtime-delta ./jre

Downloads the named runtime into ./jre, showing progress as it goes.

Download and execute

javamc execute <VERSION> <DIRECTORY> [-- JAVA_ARGS...]

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:

javamc execute java-runtime-delta ./jre -Xmx4G -jar server.jar nogui

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.