下载jdk-6u10-rc-bin-b28-linux-i586-21_jul_2008.bin
拷贝到/usr/soft/java下
并在目录/usr/soft/java下
执行./ jdk-6u10-rc-bin-b28-linux-i586-21_jul_2008.bin将开始安装
安装完成后,在目录/usr/soft/java下下生成jdk1.6.0_10文件夹
为了方便,将其重命名为jdk
mv jdk1.6.0_10 jdk
设置环境变量PATH、JAVA_HOME、JRE_HOME、CLASSPATH,修改/etc/profile文件如下:
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
fi
if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='u@h:w$ '
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi
PATH=$PATH:/usr/soft/java/jdk/bin:/usr/soft/java/jdk/jre/bin
JAVA_HOME=/usr/soft/java/jdk
JRE_HOME=/usr/soft/java/jdk/jre
CLASSPATH=.:/usr/soft/java/jdk/lib/tools.jar:/usr/soft/java/jdk/lib/dt.jar
TOMCAT_HOME=/usr/soft/tomcat/tomcat6
CATALINA_HOME=/usr/soft/tomcat/tomcat6
export PATH
export JAVA_HOME
export JRE_HOME
export CLASSPATH
export TOMCAT_HOME
export CATALINA_HOME
umask 022[@more@]