从零开始的Linux运维屌丝之路,资源免费分享平台   运维人员首选:简单、易用、高效、安全、稳定、社区活跃的开源软件

JAVA手动安装步骤1.6 1.7 1.8 1.11

发布:蔺要红07-19分类: 运维


YUM安装默认版本为 1.8
yum -y install java

[root@test01 /data/3307]# java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)

1.6手动安装
wget https://mirrors.linyaohong.com/src/tomcat/jdk-6u45-linux-x64.bin
# wget http://mirrors.linuxeye.com/jdk/jdk-6u45-linux-x64.bin

chmod +x jdk-6u45-linux-x64.bin
./jdk-6u45-linux-x64.bin
mv jdk1.6.0_45/ /usr/local/

cat >>/etc/profile <<EOF
export JAVA_HOME=/usr/local/jdk1.6.0_45
export PATH=\$JAVA_HOME/bin:\$PATH
export CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar
EOF

source /etc/profile
java -version

1.7手动安装
wget http://mirrors.linuxeye.com/jdk/jdk-7u80-linux-x64.tar.gz
# wget https://mirrors.linyaohong.com/src/tomcat/jdk-7u80-linux-x64.tar.gz

tar zxf jdk-7u80-linux-x64.tar.gz
mv jdk1.7.0_80/ /usr/local/

cat >>/etc/profile <<EOF
export JAVA_HOME=/usr/local/jdk1.7.0_80
export PATH=\$JAVA_HOME/bin:\$PATH
export CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar
EOF

source  /etc/profile
java -version


 1.8手动安装
wget http://mirrors.linuxeye.com/jdk/jdk-8u212-linux-x64.tar.gz
# wget https://mirrors.linyaohong.com/src/tomcat/jdk-8u212-linux-x64.tar.gz

tar zxf jdk-8u212-linux-x64.tar.gz 
mv jdk1.8.0_212/ /usr/local/

cat >>/etc/profile <<EOF
export JAVA_HOME=/usr/local/jdk1.8.0_212
export PATH=\$JAVA_HOME/bin:\$PATH
export CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar
EOF

source /etc/profile
java -version

 1.11手动安装
wget http://mirrors.linuxeye.com/jdk/jdk-11.0.3_linux-x64_bin.tar.gz
# wget https://mirrors.linyaohong.com/src/tomcat/jdk-11.0.3_linux-x64_bin.tar.gz

tar zxf jdk-11.0.3_linux-x64_bin.tar.gz 
mv jdk-11.0.3 /usr/local/

cat >>/etc/profile <<EOF
export JAVA_HOME=/usr/local/jdk-11.0.3
export PATH=\$JAVA_HOME/bin:\$PATH
export CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar
EOF

source /etc/profile
java -version
温馨提示如有转载或引用以上内容之必要,敬请将本文链接作为出处标注,如有侵权我会在24小时之内删除!

欢迎使用手机扫描访问本站