//创建文件夹存放java17包
mkdir -p /usr/local/soft/java
//进入目录
cd /usr/local/soft/java//下载java17
wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz
//解压java17
tar xf jdk-17_linux-x64_bin.tar.gz
//打开配置
sudo vim /etc/profile
//粘贴配置(保留第一行为了方便切换为java8)
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/git/bin
export JAVA_HOME=/usr/local/soft/java/jdk-17.0.12
export CLASSPATH=$JAVA_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH//粘贴的位置在(如下图)
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL下面
//保存并使环境变量生效
source /etc/profile
//查看java版本
java -version//Centos7 jdk17 安装字体(查看其它博主的做法,我的没生效)
在win下正确的,后面再linux下就会报这个错误,这个错误因为是系统缺少相关字体导致,因此,安装字体就可以了yum install -y fontconfig
fc-cache --force
08-07
2438
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
10-24
1987
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-28