MVN Install - Java Home Error

Asked

Viewed 67 times

1

root@vps145918:/opt/Bot# mvn install
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

System Information:

Debian 8 - 64 Bits
OVH

What to do?

1 answer

0

Apparently missing set environment variable $JAVA_HOME, follow the steps below:

  • Open the terminal and run the command find /usr/lib/jvm/java-1.x.x-openjdk
  • Next sudo vi /etc/profile
  • Press "i" to enter vi insertion mode
  • Add the lines below to the file:

    export JAVA_HOME="Add here the directory found by the command in step number 1"

    export PATH=$JAVA_HOME/bin:$PATH

  • Press "Esc" next :wq!

  • Execute the command source /etc/profile to apply the changes to your shell.

  • Try running the mvn -version command to find out if everything worked correctly

Browser other questions tagged

You are not signed in. Login or sign up in order to post.