Linux : jdk 环境变量设置

  1.  修改$HOME/.bashrc 用户环境变量

export JAVA_HOME=/usr/lib/jvm/java-6-openjdk

export JRE_HOME=/usr/lib/jvm/java-6-openjdk/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

    2. 修改 /etc/profile

export JAVA_HOME=/usr/lib/jvm/java-6-openjdk

export JRE_HOME=/usr/lib/jvm/java-6-openjdk/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

   3. 修改 /etc/environment
sudo vi /etc/environment

在environment中修改,出现如下部分(没试过)
引用:
PATH="......:/usr /lib/jvm/java-6-openjdk/bin"
CLASSPATH=.:/usr/lib/jvm/java-6-openjdk/lib
JAVA_HOME=/usr/lib/jvm/java-6-openjdk

你可能感兴趣的:(Linux : jdk 环境变量设置)