Skip to content

Java

Saphira Linux javaDragon

Java development on Saphira with proper support: apk add openjdk17 installs OpenJDK 17 (17.0.17_p10-r2) with the headless JRE, and Gradle drives builds alongside the Android tools. Saphira is the development machine; the agent, if you use one, is a tool you point at your code.

Available now from the hatched repository: apk add openjdk17

Saphira Linux dragon mascot

Install the JDK

apk add openjdk17 openjdk17-jre-headless
javac -version
# javac 17.0.17

One install gives you the full JDK plus the headless JRE for running server workloads: javac turns source into bytecode, and java launches it on the JVM, exactly as elsewhere. The package is openjdk17, currently at 17.0.17_p10-r2.

Compile and run

# Compile
javac Hello.java

# Run on the JVM
java Hello
GoodThese are the ordinary JDK commands, run against the installed OpenJDK 17, tested and working, not a promise about a future package.

Choosing a JDK version

Pick the JDK that your project targets. A newer language feature set demands a newer JDK; a conservative production build may stay on a long-supported version. Saphira's recipe pipeline carries the version as part of the package, so the JDK you build and run against is the one you intend, not whatever happened to be on the path.