title: How to correct configure grails on a ubuntu terminal?
body: <p>I have the following on my <code>.bashrc</code>:</p>
  
  <pre><code>JAVA_HOME="/usr/bin/java"
  GRAILS_HOME="/root/grails"
  PATH=$PATH:$JAVA_HOME:$GRAILS_HOME/bin
  
  export JAVA_HOME
  export GRAILS_HOME
  export PATH
  </code></pre>
  
  <p>However, when I execute <code>&gt; grails</code> in the terminal, I get:</p>
  
  <pre><code>root@localhost:~# grails
  grails: JAVA_HOME is not a directory: /usr/bin/java
  </code></pre>
  
  <p>when I tried to replace to</p>
  
  <pre><code>JAVA_HOME="/usr/share/java"
  </code></pre>
  
  <p>then the outcome is:</p>
  
  <pre><code>root@localhost:~# grails
  grails: JAVA_HOME is not defined correctly; can not execute: /usr/share/java/bin/java
  </code></pre>
  
  <p>what am I missing in there?</p>