I'm trying to install Maven on RH7 but I'm getting the error:
NB: JAVA_HOME should point to a JDK not a JRE
The thing is that I have Java is already installed and $JAVA_HOME
is defined correctly (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64
), but it has to be added to $PATH
as $JAVA_HOME/bin
and I don't have bin
in $JAVA_HOME
, the only directory I have there is jre
.
Please help!
I don't have bin in $JAVA_HOME, the only directory I have there is jre.
That almost certainly means you haven't actually got the JDK, just the jre, despite the folder name (hence the Maven error.)
Try installing / extracting the full JDK somewhere else if necessary (either by adding an external RPM and grabbing it, or just downloading it manually if you want the simple approach), then point JAVA_HOME
to that directory.