When I try to do a mvn clean install
i get the following message:
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
But when I do echo $JAVA_HOME
, I get the following output: /usr/java/openjdk/jdk-16
Which means that JAVA_HOME
is pointing to a JDK. I don't get the error.
My $PATH variable contains the jdk too:
echo $PATH
returns echo $PATH /opt/maven/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/user/bin:/usr/java/openjdk/jdk-16/bin
Any help would be appreciated
Check the case sensitivity in your JAVA_HOME definition and also check whether $JAVA_HOME/bin/java.exe is executable in the current shell
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.