Home > Net >  Ubuntu maven The JAVA_HOME environment variable is not defined correctly
Ubuntu maven The JAVA_HOME environment variable is not defined correctly

Time:06-01

I installed maven in Ubuntu 22.04 and I am getting the next error when I try a mvn clean install command:

The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

My JAVA_HOME has the next value:

echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64/bin/

Am I missing something?

Thanks!

CodePudding user response:

JAVA_HOME needs to be one level up - /usr/lib/jvm/java-11-openjdk-amd64

  • Related