Wednesday, March 17, 2010

Linux下设置环境变量

JAVA:

$ export JAVA_HOME=/usr/java/jdk1.6.0_07
$ export PATH=$PATH:$JAVA_HOME/bin

hadoop:

First setup the HADOOP_HOME environment variable to the install directory. Then append $HADOOP_HOME/bin to your PATH environment variable. It is advisable to add these to profile setup scripts.
$ export HADOOP_HOME=/u/kduan/Desktop/hadoop-0.20.2
$ export PATH=$PATH:$HADOOP_HOME/bin

要注意的是,等号的左右不能出现空格。最好修改一下.bash_profile文件,把上述export命令添加进去,这样每次用户登录时自动执行export命令。

No comments: