How To Install Java 14 on CentOS 8 / RHEL 8

Windows Articles

Configure Samba File share Services with Ubuntu 20.04 LTS

Here, Today! let's discuss samba file share service with Ubuntu 20.04 LTS. If you need to share files between Linux and MS Windows...

Install Matomo on Ubuntu 20.04

Hello, friends. In this post, you will learn how to install Matomo on Ubuntu 20.04. It's quite useful to measure the traffic to our...

How to change DNS in Windows 10

Hi! Today we will talk a bit about networks. In fact, we will touch on a topic related to connectivity. Specifically we will see...

The new Windows 10 file explorer will arrive with 21H2 update.

Hello! Microsoft does not stop working (except at Christmas) to continue polishing to Windows 10. In fact, users are gradually receiving the 20H2 update....

How to create an FTP server in Android

Hello! How are you? Currently sharing files from your PC to Android can be more comfortable and easy, without the need to use a...

Today, we are going to learn that how to install Oracle Java 14 on CentOS 8. As the Java 14 is released, you can read the new and interesting features by visiting official page.

It is used for various purposes like developing web applications, android applications, games development and much more. So, let’s move towards the installation of Java 14 on our CentOS system.

Here we’ll see the two methods to install Java 14 on CentOS 8 you can choose your preferred one for an easy installation.

Check out this

How to Install Java 14 on Ubuntu / Debian.

Step 1: Installing Java 14 on CentOS 8

Go to the official release page of JDK 14 for downloading the latest archive or use the below command to download it using the terminal.

sudo yum -y install curl
curl -O https://download.java.net/java/GA/jdk14/076bab302c7b4508975440c56f6cc26a/36/GPL/openjdk-14_linux-x64_bin.tar.gz

Output:

[sabi@localhost ~]$ curl -O https://download.java.net/java/GA/jdk14/076bab302c7b4508975440c56f6cc26a/36/GPL/openjdk-14_linux-x64_bin.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 189M 100 189M 0 0 412k 0 0:07:50 0:07:50 --:--:-- 563k

Now, extract the above package

tar xvf openjdk-14_linux-x64_bin.tar.gz

Then move the output to the /opt/ directory

sudo mv jdk-14 /opt/

And set up the Java Environment variables.

[sabi@localhost ~]$ sudo tee /etc/profile.d/jdk14.sh <<EOF
> export JAVA_HOME=/opt/jdk-14
> export PATH=$PATH:$JAVA_HOME/bin
> EOF
export JAVA_HOME=/opt/jdk-14
export PATH=$PATH:$JAVA_HOME/bin

Now, source the file

source /etc/profile.d/jdk14.sh

Verify the installation using

$ echo $JAVA_HOME
/opt/jdk-14
$ java -version
openjdk version "14" 2020-03-30
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)

Step 2: Installing Java SE Development Kit 14 on CentOS 8

As in one step we’ve installed the Java 14 using curl now we’ll install the Java SE Development Kit 14 on CentOS 8. For this you can go to the Java page and download the RPM package or by running the below command.

curl -LO -H "Cookie: oraclelicense=accept-securebackup-cookie" \
"https://download.oracle.com/otn-pub/java/jdk/14+36/076bab302c7b4508975440c56f6cc26a/jdk-14_linux-x64_bin.rpm"

Once, the package is downloaded, install it with the help of yum or rpm command.

$ sudo rpm -Uvh jdk-14_linux-x64_bin.rpm
warning: jdk-14_linux-x64_bin.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Verifying… (10################################# [100%]
Preparing… (10################################# [100%]
Updating / installing…
1:jdk-14-2000:14-ga ################################# [100%]

Verify the installation of Java 14 by running

java -version
java version "14" 2020-03-30
Java(TM) SE Runtime Environment (build 14+36-1461)
Java HotSpot(TM) 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)

Now, set up the Java environment

cat <<EOF | sudo tee /etc/profile.d/jdk14.sh
export JAVA_HOME=/usr/java/default
export PATH=$PATH:$JAVA_HOME/bin
EOF

Then source the file

source /etc/profile.d/jdk14.sh

Step 3: Set Java Version as Default Version

If you’ve installed multiple java version, you can configure them to choose which one is default.

sudo alternatives --config java

So, this is how you can install Java 14 on CentOS8.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

Configure Samba File share Services with Ubuntu 20.04 LTS

Here, Today! let's discuss samba file share service with Ubuntu 20.04 LTS. If you need to share files between Linux and MS Windows...

Install Matomo on Ubuntu 20.04

Hello, friends. In this post, you will learn how to install Matomo on Ubuntu 20.04. It's quite useful to measure the traffic to our...

How to change DNS in Windows 10

Hi! Today we will talk a bit about networks. In fact, we will touch on a topic related to connectivity. Specifically we will see...

The new Windows 10 file explorer will arrive with 21H2 update.

Hello! Microsoft does not stop working (except at Christmas) to continue polishing to Windows 10. In fact, users are gradually receiving the 20H2 update....

How to create an FTP server in Android

Hello! How are you? Currently sharing files from your PC to Android can be more comfortable and easy, without the need to use a...
x