centos7安装java教程

centos7安装java教程

版本:jdk1.8.0_301

1、下载jdk

https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html

 

 

2、安装jdk

tar -xzf jdk-8u301-linux-x64.tar.gz

mv jdk1.8.0_301 /usr/local/jdk1.8.0

3配置java环境变量

vim /etc/profile

#java

export JAVA_HOME=/usr/local/jdk1.8.0

export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOMR/bin

source /etc/profile #生效

4、测试

 

posted @ 2021-09-08 09:15  钱哥的博客  阅读(1083)  评论(0编辑  收藏  举报