欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

AWS的redhat7中安装jdk8

程序员文章站 2022-04-08 19:17:00
下载jdk8 wget https://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.tar.gz?AuthParam=1545702611_98... ......

下载jdk8

wget https://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-linux-x64.tar.gz?authparam=1545702611_985353507b7b4664bfce283ab5218681

tar zxvf jdk-8u191-linux-x64.tar.gz 

cd jdk1.8.0_191/

vim /etc/profile在结尾加入:

export java_home=/usr/java
export classpath=.:$java_home/jre/lib/rt.jar:$java_home/lib/dt.jar:$java_home/lib/tools.jar
export path=$path:$java_home/bin 

 source /etc/profile

完成,运行正常:java -version