Skip to content

java template does not set JAVA_HOME correct #345

@gmuth

Description

@gmuth

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions