Introduction
jpx runs an already-published module or Maven artifact with one command. Point it at a target and it
resolves the dependency closure, installs it once under your home directory, and launches the main entry
point. It is npx for Java: a way to run a released tool without cloning, building, or wiring up its paths
by hand.
jpx org.junit.platform.console --version
That resolves the JUnit console launcher and its dependencies, installs them, and runs the tool. The
--version is passed straight through to the launched program.
Getting jpx
A package manager installs jpx as a command of its own, with no project and no build tool around it. A JDK, version 25 or newer, is the only prerequisite:
sdk install jpx # SDKMAN
brew install jenesis/tap/jpx # Homebrew
scoop bucket add jenesis https://github.com/jenesis/scoop-bucket && scoop install jpx # Scoop
jpx org.junit.platform.console --version
jpx also ships inside the Jenesis build tool. Every project that carries the tool's sources under
build/ - whether they arrived through jenesis-init, the curl bootstrap, or the git submodule
described in the tool's Getting started - has jpx in that folder, launched by the JDK
directly:
java build/jenesis/Jpx.java org.junit.platform.console --version
With JBang, neither is needed: the jenesis/ repository carries a JBang
catalogue with a jpx alias, which runs the released jpx from Maven Central on a JDK that JBang downloads
where the machine has none of version 25 or newer:
jbang jpx@jenesis/jenesis org.junit.platform.console --version
JBang verifies less of what it downloads than a package manager does, as the tool's Getting started describes.
All three run the same program and take the same arguments. The examples in this section write jpx.
The same three steps - resolve, install, launch - are also a public API, so a program of your own can run a published module too.
What's in this section
- Introduction - you are here.
- Choosing a target - the target grammar: a module name or Maven coordinate, a version, an entry point.
- Installation & caching - where installs live, what the descriptor records, and what makes an install safe to reuse.
- Isolation & verification - running the launched program in a container and pinning it to a trusted digest.
- Using jpx from Java - the same resolve, install, and launch sequence as an API.
- Reference - every flag, the exit codes, and the API surface in one table.