Show HN: Zero JDK – Java builds without installing Java

1 julien-may 2 5/27/2025, 4:49:19 PM github.com ↗
Zero JDK is a POSIX-compliant shell script that bootstraps a Java project by downloading and setting up the required JDK (via a custom URL in .jdk/config.properties). It works without needing Java installed globally.

It also supports installing Maven or Gradle wrappers, so that a new contributor or CI runner can clone the repo, run ./build init, and build the project without touching system state.

I made this because I kept jumping between projects with different JDK versions, and I wanted a zero-dependency way to ensure reproducible builds. Inspired by the simplicity of scripts like mvnw or gradlew, but extended to also bootstrap the JDK itself.

It currently supports macOS and Linux. Curious if others find this useful and happy for feedback or contributions.

Comments (2)

gavinray · 1d ago
Gradle wrapper scripts when combined with the new-ish Gradle Toolchains feature already fetch both Gradle and the required JDK version, though?

https://docs.gradle.org/current/userguide/toolchains.html#se...

  > Using Java toolchains allows Gradle to automatically download and manage the required JDK version for your build.
julien-may · 1d ago
You’re absolutely right! Gradle’s toolchain support is a great step forward, and I really like how it can now manage JDKs automatically based on build requirements.

That said, the key difference here is when the JDK is provisioned. Gradle’s toolchain support assumes you already have a working Java runtime to start Gradle itself. So on a fresh machine (or CI container) without Java, the build still won’t start.

Zero JDK is meant to handle that very first step by making it possible to init in a repo without requiring Java, Maven, or Gradle to be installed at all. It’s basically a lightweight bootstrapper that bridges the gap before the build tools kick in.

That said, thanks for sharing. I wasn’t even aware how far Gradle toolchains has come recently. Definitely something I’ll explore further!