[Solved] How-To: Install Java 17 on CentOS Stream 8

Install Java 17 on CentOS Stream 8

You can install JAVA 17 on any version of CentOS Linux without any hassle using few commands. Yum has the capability to pull the installer from internet URLS and install any application in couple of commands and steps. Yum command needs some configuration and location from where it will get the installer and install it on Linux machine. The default installation of CentOS Stream 8 comes with baseOS URLs which might not work for some users (I don’t know the reason). All you need to do is to modify those files and add updated baseOS user to install Java 17 on CentOS stream 8. Follow under given instructions to modify the files and then run the yum commands to install Java 17 on CentOS Stream 8

Open your CentOS-Linux-AppStream.repo and CentOS-Linux-BaseOS.repo files in vim (because I love it).

Change directory and move to /etc/yum.repos.d/ so that the appropriate files can be modified.

cd /etc/yum.repos.d/

Edit CentOS-Base.repo file

vi /etc/yum.repos.d/CentOS-Base.repo

Comment out the baseurl line with hash sign or you can remove it (Better safe than sorry).

CentOS-Linux-BaseOS.repo
#baseurl=http://mirrors.linode.com/$contentdir/$releasever/BaseOS/$basearch/os/

add under given line in the file

CentOS-Linux-BaseOS.repo
baseurl=http://vault.centos.org/$contentdir/$releasever/BaseOS/$basearch/os/

Press escape, save and exit the file by using under given parameters (vi editor)

:wq!

Edit CentOS-Linux-AppStream.repo file

install JDK

Follow the same instructions to open and edit the file like given above.

vi /etc/yum.repos.d/CentOS-AppStream.repo

CentOS-Linux-AppStream.repo
#baseurl=http://mirrors.linode.com/$contentdir/$releasever/AppStream/$basearch/os/

Comment out the baseurl line with hash sign or you can remove it (Better safe than sorry).

CentOS-Linux-AppStream.repo
baseurl=http://vault.centos.org/$contentdir/$releasever/AppStream/$basearch/os/

Press escape, save and exit the file by using under given parameters (vi editor)

:wq!


Run yum update again.

Now run under given command to install Java 17:

sudo yum install java-17-openjdk

I hope this article will help install Java 17 without any problem.

[Solved] How to Install Tomcat5 and JDK5 on Ubuntu 20.04 LTS

[Solved] How to Install JDK5 on Ubuntu 16.04

Azhar Ali Buttar has 20 years of experience working in different domains within IT industry. From network protocols to server hardening, he knows about multiple areas and has been working side by side with MNCs to provide cost-effective security and infrastructure solutions. Azhar’s expertise lies in off-site and hybrid infrastructure deployment using multiple platforms which includes, but not limited to, Azure, AWS, Google and Private Clouds. He has also been leading several infrastructure and security teams to deploy and perform security optimization in multiple projects, and now leads Nocastra with his decision-making and client-oriented skills.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.