java Grails:JAVA_HOME 定义不正确

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5098940/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 09:25:58  来源:igfitidea点击:

Grails: JAVA_HOME is not defined correctly

javagrailsgroovyjava-home

提问by Droid

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/profileand ~/.profile this:

每次崩溃时,我都尝试在终端中安装 Grails 框架和命令“grails”。我使用Debian的挤压,我集/etc/profile~/.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?

怎么了?

回答by Ray Tayek

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

确保它JAVA_HOME指向 jdk,而不仅仅是 jvm。请参阅:http: //www.grails.org/Installation

You may need to add ${JAVA_HOME}/binto your PATHalso.

您可能需要添加${JAVA_HOME}/bin到您的PATH也。

回答by Droid

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 

回答by Burt Beckwith

Should be

应该

export PATH=$GRAILS_HOME/bin:$PATH

and you can test it from the commandline with

你可以从命令行测试它

echo $PATH

and

java -version