Grails: JAVA_HOME is not defined correctly

13.1k Views Asked by At

I have tried to install Grails framework and command "grails" in terminal every time crashes. I am using Debian Squeeze and I set in /etc/profile and ~/.profile this:

export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.22
export GRAILS_HOME="/home/snitch/grails"
export PATH=${PATH}:${GRAILS_HOME}/bin

What is wrong?

3

There are 3 best solutions below

1
On BEST ANSWER

Solved.

JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.22 
export JAVA_HOME 
GRAILS_HOME=/home/snitch/grails 
export GRAILS_HOME 
PATH=$PATH:$GRAILS_HOME/bin:$JAVA_HOME/bin 
export PATH 
0
On

Make sure that JAVA_HOME points to a jdk, not just a jvm. See: http://www.grails.org/Installation.

You may need to add ${JAVA_HOME}/bin to your PATH also.

2
On

Should be

export PATH=$GRAILS_HOME/bin:$PATH

and you can test it from the commandline with

echo $PATH

and

java -version