Hello and thank you for any help you can provide.
I just upgraded to Ubuntu 18.04.1 and before the install my JAVA_HOME for my path was defined properly and worked successfully. However, I am now unable to use Maven due to the following error: "JAVA_HOME should point to a JDK not a JRE"
. I know this is a common problem and I tried a lot of potential solutions before making this post.
When I echo $JAVA_HOME
, I get back /usr/lib/jvm/java-11-openjdk-amd64/bin
which is what I set it to be in my .bashrc via the following lines:
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin
export JAVA_HOME
PATH=$PATH:$JAVA_HOME
export PATH
From there, I also checked Which java
where I got the output of /usr/bin/java. I checked further and found that readlink -f /usr/bin/java
returns a value of /usr/lib/jvm/java-11-openjdk-amd64/bin/java
. Again, this points to a JDK not a JRE.
I also attempted to fix the issue by configuring a java with sudo update-alternatives --config java
and chose the value of /usr/lib/jvm/java-11-openjdk-amd64/bin/java
To top it all off, I have reinstalled java and maven and I have restarted my computer and command line multiple times.