I have the following on my .bashrc:
JAVA_HOME="/usr/bin/java"
GRAILS_HOME="/root/grails"
PATH=$PATH:$JAVA_HOME:$GRAILS_HOME/bin
export JAVA_HOME
export GRAILS_HOME
export PATH
However, when I execute > grails in the terminal, I get:
root@localhost:~# grails
grails: JAVA_HOME is not a directory: /usr/bin/java
when I tried to replace to
JAVA_HOME="/usr/share/java"
then the outcome is:
root@localhost:~# grails
grails: JAVA_HOME is not defined correctly; can not execute: /usr/share/java/bin/java
what am I missing in there?
I would expect
JAVA_HOMEto contain thebindirectory containingjava(and others).So clearly those two options you’ve selected are not correct.
Looking at my Ubuntu installation, I have numerous Java packages under
/usr/lib/jvm, and I would select an appropriate one there e.g.