IMPORTANT NOTE: We're starting to migrate contents of this repo to the devcontainers org, as part of the work on the open dev container specification.
We've currently migrated the java Feature to devcontainers/features/src/java.
For more details, you can review the announcement issue.
Installs Java, SDKMAN! (if not installed), and needed dependencies.
Script status: Stable
OS support: Debian 9+, Ubuntu 18.04+, and downstream distros.
Maintainer: The VS Code and GitHub Codespaces teams
./gradle-debian.sh [Java version] [SDKMAN_DIR] [Non-root user] [Add rc files flag]
Or as a feature:
"features": {
"java": "latest"
}You can use this script for your primary dev container by adding it to the features property in devcontainer.json.
"features": {
"java": "latest"
}If you have already built your development container, run the Rebuild Container command from the command palette (Ctrl/Cmd + Shift + P or F1) to pick up the change.
-
Add
java-debian.shto.devcontainer/library-scripts -
Add the following to your
.devcontainer/Dockerfile:ENV SDKMAN_DIR="/usr/local/sdkman" ENV PATH=${SDKMAN_DIR}/bin:${SDKMAN_DIR}/candidates/java/current/bin:${PATH} COPY library-scripts/java-debian.sh /tmp/library-scripts/ RUN apt-get update && bash /tmp/library-scripts/java-debian.sh "lts" "${SDKMAN_DIR}"
That's it!
