首页 > 系统相关 >CentOS7源码安装jdk11

CentOS7源码安装jdk11

时间:2023-01-03 15:12:26浏览次数:71  
标签:jdk local 11.0 jdk11 CentOS7 源码 16.1 root localhost

CentOS7源码安装jdk11

1.下载jdk    

官网下载

如有旧版本请先卸载openjdk:

[root@localhost ~]# yum erase `rpm -qa | grep openjdk` -y

2.解压安装

[root@localhost ~]# tar -xvf jdk-11.0.16.1_linux-x64_bin.tar.gz -C /usr/local/
[root@localhost ~]# cd /usr/local/
[root@localhost local]# ll jdk-11.0.16.1

3.修改环境变量

[root@localhost ~]# vim /etc/profile
#jdk-11.0.16.1
export JAVA_HOME=/usr/local/jdk-11.0.16.1
export PATH=$PATH:$JAVA_HOME/bin

[root@localhost ~]# source /etc/profile

4.查看java版本

[root@localhost ~]# java -version
java version "11.0.16.1" 2022-08-18 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.16.1+1-LTS-1)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.16.1+1-LTS-1, mixed mode)

 

 

标签:jdk,local,11.0,jdk11,CentOS7,源码,16.1,root,localhost
From: https://www.cnblogs.com/haoee/p/17022283.html

相关文章