Recently Java 15 has been released with interesting new features in the accounting field and introducing many security patches. In spite of this, it can now be installed in Linux either as compiled packages or by downloading the binaries. Well, in this post, I will show you how to install Java 15 on CentOS 8 / CentOS 7
One of the biggest strengths of CentOS is that it has a wide range of packages and programs that can be installed. On the other hand, the CentOS project has many communities and official repositories that extend even more the functionality of the distribution.
OpenJDK or Oracle Java
Since Java version 11, the license has changed and become a little more restrictive for commercial purposes. However, OpenJDK continues to run alongside the commercial version that includes professional support.
The above situation opens a small controversy about which implementation to use. And the answer depends on each developer however, with OpenJDK you will not have license problems and is ideal for testing features and educational projects.
Well, for this tutorial I will choose OpenJDK. Do not worry it is Java but open source.
Let’s go for it.
Install Java 15 on CentOS 8 / Centos 7
Java 15 is available as an RPM package from the Oracle website. So you can go to the download section and download the RPM package corresponding to your processor architecture.
However, using the terminal and wget command is faster and even easier.
So, open the terminal or start an SSH session and type the following command.
wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/15+36/779bf45e88a44cbd9ea6621d33e33db1/jdk-15_linux-x64_bin.rpm
And it will automatically start the download.
You can then install the package locally with DNF.
sudo dnf localinstall jdk-15_linux-x64_bin.rpm Failed to set locale, defaulting to C.UTF-8 Last metadata expiration check: 0:01:51 ago on Wed Sep 23 11:22:58 2020. Dependencies resolved. Package Architecture Version Repository Size Installing: jdk-15 x86_64 2000:15-ga @commandline 162 M Transaction Summary Install 1 Package Total size: 162 M Installed size: 314 M Is this ok [y/N]
Once the installation is complete, if you have several versions of Java you can choose the default by running the following command:
sudo alternatives --config java There is 1 program that provides 'java'. Selection Command *+ 1 /usr/java/jdk-15/bin/java Enter to keep the current selection[+], or type selection number:
Although in my case I only have this installation.
Finally, check the JAva version to see if the command works correctly:
java --version java version "15" 2020-09-15 Java(TM) SE Runtime Environment (build 15+36-1562) Java HotSpot(TM) 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)
So, enjoy it.
Conclusion
Java is an old rocker who has a lot to contribute. So it is not surprising that he is a valued Oracle and has very active development. Now with version 15, you can enjoy attractive new features.
So, enjoy it. Share this post and join our Telegram Channel.