title: JAVA_HOME should point to a JDK not a JRE + JAVA_HOME is not defined correctly
body: <p>I've edited my <code>.bashrc</code> file on my server, with <strong><code>sudo nano ~/.bashrc</code></strong></p>
  <pre><code>export JAVA_HOME=/usr/bin/java
  export PATH=${PATH}:${JAVA_HOME}/bin
  </code></pre>
  <p>I've re-logged in, and here is all the path as output:</p>
  <pre><code>root@ubuntu-s-1vcpu-1gb-blr1-01:~/maifee/backend-spring# echo $JAVA_HOME
  /usr/bin/java
  root@ubuntu-s-1vcpu-1gb-blr1-01:~/maifee/backend-spring# echo $PATH
  /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/bin/java/bin
  </code></pre>
  <p>But when I try to run my spring boot server, it gives me:</p>
  <pre><code>root@ubuntu-s-1vcpu-1gb-blr1-01:~/maifee/backend-spring# ./mvnw spring-boot:run
  Error: JAVA_HOME is not defined correctly.
    We cannot execute /usr/bin/java/bin/java
  </code></pre>
  <p>And when I try to do a <code>mvn install</code>, I get:</p>
  <pre><code>root@ubuntu-s-1vcpu-1gb-blr1-01:~/maifee/backend-spring# 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
  </code></pre>
  <p>But here is the java configuration list:</p>
  <pre><code>root@ubuntu-s-1vcpu-1gb-blr1-01:~/maifee/backend-spring# sudo update-alternatives --list java
  /usr/lib/jvm/java-11-openjdk-amd64/bin/java
  /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
  </code></pre>
  <p>And when I try to run(just tried, without installing dependencies), I get:</p>
  <pre><code>root@ubuntu-s-1vcpu-1gb-blr1-01:~/maifee/backend-spring# ./mvnw spring-boot:run
  Error: JAVA_HOME is not defined correctly.
    We cannot execute /usr/bin/java/bin/java
  </code></pre>
  <p>How can I set up my environment to correctly, run my Spring Boot server? I directly have source code there, I don't even need compiling and stuffs.</p>