The template uses ms openjdk and adds support for mvn and gradle via the java feature.
{
"name": "Java",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/java:1-21-bullseye",
"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "none",
"installMaven": "true",
"installGradle": "true"
}
}
}
The container than has JAVA_HOME pointing to /usr/local/sdkman/candidates/java/current which does not exist.
MS jdk is installed at /usr/lib/jvm/msopenjdk-current/bin/java
$ mvn
The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.
The template uses ms openjdk and adds support for mvn and gradle via the java feature.
The container than has JAVA_HOME pointing to
/usr/local/sdkman/candidates/java/currentwhich does not exist.MS jdk is installed at
/usr/lib/jvm/msopenjdk-current/bin/java