0

Here is an example of how the result looks like. I believe it shouldn't be like that.

user@user:~$ echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64/bin/java:/usr/lib/jvm/java-11-openjdk-amd64/bin/java

It also influences maven commands, since I get the following error when running any of maven 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

2 Answers2

1

You'll want to fix that. JAVA_HOME should be a single location.

try export JAVA_HOME=$(/usr/libexec/java_home)

and source ~/.bash_profile (or set in your .zshrc file)

swedishcheef
  • 549
  • 2
  • 11
  • 25
0

Figured out how to solve the issue and set the variables permanently with help of the instruction: https://www.configserverfirewall.com/ubuntu-linux/set-java-home-ubuntu/