As of November 2020
you can achieve this in 2 steps:
Install Java 11 using
yum:yum install java-11-openjdk-develGet all the Java configurations available in your machine:
alternatives --config javaRun the above command, select the version you want to set, I've set
1here:There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- 1 java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.8.10-0.el7_8.x86_64/bin/java) *+ 2 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java) Enter to keep the current selection[+], or type selection number: 1Check
java -version:openjdk version "11.0.8" 2020-07-14 LTS OpenJDK Runtime Environment 18.9 (build 11.0.8+10-LTS) OpenJDK 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode, sharing)
Java 11 is now set to be used globally.
Answer from Asad Shakeel on Stack OverflowAs of November 2020
you can achieve this in 2 steps:
Install Java 11 using
yum:yum install java-11-openjdk-develGet all the Java configurations available in your machine:
alternatives --config javaRun the above command, select the version you want to set, I've set
1here:There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- 1 java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.8.10-0.el7_8.x86_64/bin/java) *+ 2 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre/bin/java) Enter to keep the current selection[+], or type selection number: 1Check
java -version:openjdk version "11.0.8" 2020-07-14 LTS OpenJDK Runtime Environment 18.9 (build 11.0.8+10-LTS) OpenJDK 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode, sharing)
Java 11 is now set to be used globally.
The reason, in short, is because someone has to maintain the packages and put these into the repositories your system is using and verify, that they run stable. For example, the OpenJDK 11 on Debian is still in buster (testing) and sid (unstable) and therefore not available in any stable branch. I guess in CentOS (I am not that familiar with it tbh.) it's the same situation.
Sooner or later you'll have to install software without a manager in any OS, so even if you're saying you're a noob, you'll have to learn that sooner or later. And if you want to use openjdk11 now, you'll have to use either an unofficial repository or install the software by hand, what I'd recommend.
However, here is a guide which is the second hit on Google for openjdk11 centos:
curl -O https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz
tar zxvf openjdk-11.0.1_linux-x64_bin.tar.gz
mv jdk-11.0.1 /usr/local/
vi /etc/profile.d/jdk11.sh
# create new
export JAVA_HOME=/usr/local/jdk-11.0.1
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile.d/jdk11.sh
java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
Source: https://www.server-world.info/en/note?os=CentOS_7&p=jdk11&f=2
Cent OS 7 (EOL) how to install Java 1:11.0.0 for 4.8
CentOS 8 + Java 11
rhel - Can I use centOS and Redhat's JDK-11 altogether in my production server - Unix & Linux Stack Exchange
Java 11- centos 6
If your looking for a RPM from redhat you might be out of luck with 6.
https://access.redhat.com/articles/1299013#OpenJDK_Lifecycle_Dates_and_RHEL_versions
More on reddit.comVideos
Hey,
OpenJDK 11 ***
We're looking at pushing out Java 11 to around 40 centos 6 servers (upgrades are in the pipeline to be upgraded).
I can see from research you can manually install it by wget the files etc. but they are not available in the repository yet.
On a centos7 box I can yum search and find version 11 in there.
Is there any news on java 11 becoming available for the centos 6 repos?
Thanks in advance.