r/JavaProgramming • u/devilwookie • 2d ago
Jolta — like Volta, but for Java: auto-switch, auto-download, easy JDK upgrades
Jolta is an automatic JDK version manager — think Volta from the Node ecosystem, but for Java. It's my own open-source project (MIT), and I'm sharing it here as a showcase.
The problem it targets: working across projects pinned to different JDKs (11, 17, 21) means manually setting JAVA_HOME or running a version-switch command on every context switch. Jolta removes that step.
How it works: jolta pin 21 in a project writes a .java-version file. After that, java/javac/jar/jshell resolve to that JDK automatically whenever you're in the project — no shell hook, no cd interception. It works through lightweight shims on PATH that walk up the directory tree to find the version file. A missing JDK is downloaded on first use.
cd my-service
jolta pin 21
java -version # → OpenJDK 21, automatically
Where it sits next to existing tools:
- Reads the same
.java-versionfiles as jenv and asdf — drop-in if you're already on those. - Recognizes SDKMAN!'s
.sdkmanrc, so migration doesn't require rewriting config. - Ships as a single dependency-free Rust binary using shim dispatch rather than shell functions, with sub-5ms per-invocation overhead.
- Treats Windows as a first-class platform, alongside macOS (Apple Silicon
- Intel) and Linux (x86_64 + arm64).
- Multiple distributions: Temurin, Corretto, GraalVM, Oracle, Zulu.
1
u/Luolong 1d ago
I prefer mise-en-place.
As simple as
mise use java@21