images icon indicating copy to clipboard operation
images copied to clipboard

Correct way to setup plain java with maven?

Open nmwael opened this issue 3 months ago • 2 comments

I have this

  "image": "mcr.microsoft.com/devcontainers/java:1-21-bullseye",
  "features": {
    "ghcr.io/devcontainers/features/java:1": {
      "version": "none",
      "installMaven": "true",
    }
  },

When running my maven command: mvn clean install I get the error message:

The JAVA_HOME environment variable is not defined correctly,
this environment variable is needed to run this program.

I would have expected that JAVA_HOME would be setup? I would also expect that the JDK or JRE installed would be the most upstream origin, eg OpenJDK.. It seems it an MS variant.

nmwael avatar Nov 28 '24 07:11 nmwael