Skip to content

Correct way to setup plain java with maven? #1244

@nmwael

Description

@nmwael

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.

Metadata

Metadata

Assignees

No one assigned

    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