'JAVA_HOME should point to a JDK not a JRE On linux mint
If anyone can help it would mean a lot, as there are many similarly answered questions but mostly for windows, I am running Linux mint 20.2 (Uma).
As the title states I cannot launch maven without the error popping up, I've set the jdk and maven path, but it just doesn't seem to work, echoing the path gives me this output
brainlet@brainlet-HP-ProBook-450-G6:~$ echo $JAVA_HOME
/usr/java/jdk-16.0.2
brainlet@brainlet-HP-ProBook-450-G6:~$ echo $M2_HOME
/opt/apache-maven
brainlet@brainlet-HP-ProBook-450-G6:~$ echo $M2
/opt/apache-maven/bin
brainlet@brainlet-HP-ProBook-450-G6:~$
And trying to run maven at all, I get this output
brainlet@brainlet-HP-ProBook-450-G6:~$ mvn
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
I cannot figure out why it keeps bringing up the error, nor can I find a specific solution for my problem. Any input is much appreciated, and thank you all in advance.
Solution 1:[1]
I fixed that by specifying the correct JDK path in ~/.mavenrc file.
$ cat ~/.mavenrc
export JAVA_HOME=/usr/lib/jvm/java-1.13.0-openjdk-amd64
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
