rehl5安装jdk

{{{ 解压jdk.tar.gz到任意目录

/etc/profile文件 -- 全部用户有效

在profile 文件的尾部面加入

JAVA_HOME=/usr/java/jdk1.5.0_16 -- jdk 的安装路径 PATH=$JAVA_HOME/bin:$PATH CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export JAVA_HOME export PATH export CLASSPATH export CATALINA_HOME

保存 退出 在shell输入 source /etc/profile }}}

set default jdk for debin {{{

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-sun/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-7-sun/bin/javac 300
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/java-7-sun/bin/jar 300
sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/java-7-sun/bin/javah 300
sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/java-7-sun/bin/javap 300

sudo update-alternatives --config java
}}}

Comments !