OpenJDK
Status
Section titled “Status”Version: 1.0.0 | Tests: Passing
{
"features": {
"ghcr.io/infrashift/trusted-devcontainer-features/openjdk:latest": {
"target_major_version": "21",
"target_version": "21.0.6+7"
}
}
} Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
target_major_version | string | 21 | Select the OpenJDK major version |
target_version | string | 21.0.6+7 | Select the full OpenJDK version string |
target_checksum | string | "" | SHA256 checksum for the OpenJDK tarball |
Dependencies
Section titled “Dependencies”None — this feature is independent and has no dependencies.
How It Works
Section titled “How It Works”This feature downloads Eclipse Temurin OpenJDK from the Adoptium project. The Ansible playbook downloads the JDK tarball for the specified major and full version (OpenJDK<major>U-jdk_x64_linux_hotspot_<version>.tar.gz), optionally verifies the SHA256 checksum if one is provided, and extracts it to ~/.local/share/java.
After extraction, the playbook configures JAVA_HOME to point to the installed JDK directory and adds the JDK bin directory to PATH, making java, javac, and all other JDK tools immediately available. The VS Code Java Extension Pack is recommended for a full-featured Java development experience in the devcontainer.
This is the only feature in the collection that uses a separate major version option (target_major_version) in addition to the full version string (target_version). The major version is needed because the Adoptium download URL structure uses the major version in the path, while the full version string (e.g., 21.0.6+7) is used for the tarball filename. Both values must be provided and must be consistent with each other for the download to succeed.