MVN Install - Java Error Home

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?

    
asked by anonymous 13.04.2018 / 20:29

1 answer

0

Apparently missing the $ JAVA_HOME environment variable, 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 insert mode
  • Add the following lines 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" then :wq!

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

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

26.12.2018 / 12:02