centos: 安装 java 17
在 centos7 上安装 java17
安装步骤
wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.rpm
sudo rpm -ivh jdk-17_linux-x64_bin.rpm
centos8上
# 安装17
yum install java-17-openjdk -y
删除老的java
如果存在多个版本,有可能出现一直显示的是原来的版本的情况。
# 列出
rpm -qa | grep java
# 删除不需要的
yum remove java-1.8.0-openjdk-headless-1.8.0.312.b07-2.el8_5.x86_64
# 这种一般是系统自带的
yum remove java
参考
- https://vegastack.com/tutorials/how-to-install-java-on-centos-7/
- https://unix.stackexchange.com/questions/703538/openjdk-17-for-centos-7
- https://rpmfind.net/linux/rpm2html/search.php?query=java-17-openjdk
- https://www.digitalocean.com/community/tutorials/how-to-install-java-on-centos-and-fedora
- https://unix.stackexchange.com/questions/110512/uninstall-jdk-rpm-to-reinstall