下载
上传到linux server
#chmod +x jdk-1_5_0_02-linux-i586.rpm.bin
#./jdk-1_5_0_02-linux-i586.rpm.bin
设置环境变量。
#vi /etc/profile
在最后面加入
#set java environment
JAVA_HOME=/usr/java/jdk-1_5_0_02
CLASSPATH=.:$JAVA_HOME/lib.tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
保存退出。
source /etc/profile
# ll /usr/bin/java
lrwxrwxrwx 1 root root 22 07-22 23:05 /usr/bin/java -> /etc/alternatives/java
# ll /etc/alternatives/java
lrwxrwxrwx 1 root root 35 07-22 23:05 /etc/alternatives/java -> /usr/lib/jvm/jre-1.4.2-gcj/bin/java
# rpm -qa|grep java
sun-javadb-docs-10.4.2-1.1
sun-javadb-core-10.4.2-1.1
sun-javadb-client-10.4.2-1.1
sun-javadb-demo-10.4.2-1.1
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
sun-javadb-common-10.4.2-1.1
sun-javadb-javadoc-10.4.2-1.1
# rpm -qf /usr/lib/jvm/jre-1.4.2-gcj/bin/java
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
# rm -f /usr/bin/java
# rm -f /usr/bin/javac
# ln -s /usr/java/jdk1.6.0_17/bin/java /usr/bin/java
# ln -s /usr/java/jdk1.6.0_17/bin/javac /usr/bin/javac
# java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)
#
OK
上传到linux server
#chmod +x jdk-1_5_0_02-linux-i586.rpm.bin
#./jdk-1_5_0_02-linux-i586.rpm.bin
设置环境变量。
#vi /etc/profile
在最后面加入
#set java environment
JAVA_HOME=/usr/java/jdk-1_5_0_02
CLASSPATH=.:$JAVA_HOME/lib.tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
保存退出。
source /etc/profile
# ll /usr/bin/java
lrwxrwxrwx 1 root root 22 07-22 23:05 /usr/bin/java -> /etc/alternatives/java
# ll /etc/alternatives/java
lrwxrwxrwx 1 root root 35 07-22 23:05 /etc/alternatives/java -> /usr/lib/jvm/jre-1.4.2-gcj/bin/java
# rpm -qa|grep java
sun-javadb-docs-10.4.2-1.1
sun-javadb-core-10.4.2-1.1
sun-javadb-client-10.4.2-1.1
sun-javadb-demo-10.4.2-1.1
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
sun-javadb-common-10.4.2-1.1
sun-javadb-javadoc-10.4.2-1.1
# rpm -qf /usr/lib/jvm/jre-1.4.2-gcj/bin/java
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
# rm -f /usr/bin/java
# rm -f /usr/bin/javac
# ln -s /usr/java/jdk1.6.0_17/bin/java /usr/bin/java
# ln -s /usr/java/jdk1.6.0_17/bin/javac /usr/bin/javac
# java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)
#
OK