It appears than the option --list doesn't take arguments, it's a bug in the manual synopsis.Moreover for manage my java versions I should try env variables.

(The bug has been reported as https://github.com/fedora-sysv/chkconfig/issues/11)

Answer from UnRealCloud on Stack Overflow
🌐
CentOS
wiki.centos.org › HowTos › JavaRuntimeEnvironment
How to install the Java Runtime Environment from Java.com
# alternatives --install /usr/bin/java java /usr/java/latest/bin/java 3 # alternatives --config java There are 3 programs which provide 'java'. Selection Command ----------------------------------------------- *+ 1 /usr/lib/jvm/jre-1.6.0-openjdk/bin/java 2 /usr/lib/jvm/jre-1.5.0-gcj/bin/java 3 /usr/java/latest/bin/java Enter to keep the current selection[+], or type selection number: 3 # java -version java version "1.6.0_30" Java(TM) SE Runtime Environment (build 1.6.0_30) Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)
Discussions

linux - installing java on centos with alternatives - Stack Overflow
I want to upgrade java version on my CentOS (previously 1.8.0_144, now 1.8.0.201). I used following command: alternatives --install /usr/bin/java java /usr/java/jdk1.8.0_201/jre/bin/java 180201 No... More on stackoverflow.com
🌐 stackoverflow.com
Centos 8 -> Rocky Linux -> Java alternatives missing
I migrated some machines from Centos 8.x to RockyLinux 8.4 with the script migrate2rocky.sh (Migrating To Rocky Linux - Documentation), and generally, all goes well. But in some servers, I use various versions of Java, and before to migrate I can use the command alternatives to choose the java ... More on forums.rockylinux.org
🌐 forums.rockylinux.org
1
0
September 22, 2021
Dealing with Java Environments on CentOS and Ubuntu - Knowledge Base - OpenNMS Community
A working Java environment is crucial for running OpenNMS services and there are many ways how to set up a Java environment. This guide explains how you can use the tools coming with CentOS 7 and Ubuntu 18 LTS to control and troubleshoot your Java environment on a server with a CLI. ℹ For ... More on opennms.discourse.group
🌐 opennms.discourse.group
2
July 2, 2024
Does anyone happen to know if I can safely remove java-11-openjdk if I install java-17-openjdk on alma 8 and 9?
Alternatives will take care of this for you no problem. If you yum remove openjdk, it will tell you if anything is depending on it and will remove those things too potentially More on reddit.com
🌐 r/AlmaLinux
10
1
September 11, 2023
🌐
SysAdminXpert
sysadminxpert.com › home › linux › steps to upgrade java 8 to java 11 on centos 7
Steps To Upgrade Java 8 To Java 11 On CentOS 7 | SysAdminXpert
June 7, 2024 - Just enter the number when prompted which will change the default Java version. ... [root@CentOS-7 ~]# sudo alternatives --config java There are 3 programs which provide 'java'. Selection Command ----------------------------------------------- 1 java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.221-2.6.18.1.el7.x86_64/jre/bin/java) *+ 2 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b03-1.el7.x86_64/jre/bin/java) 3 java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.7.10-4.el7_8.x86_64/bin/java) Enter to keep the current selection[+], or type selection number: 3 [root@CentOS-7 ~]#
🌐
G2
g2.com › products › openjdk-11-java-11-on-centos-8 › competitors › alternatives
Top 10 OpenJDK 11 (Java 11) on CentOS 8 Alternatives & Competitors in 2026 | G2
The best OpenJDK 11 (Java 11) on CentOS 8 alternatives are Amazon Corretto, Red Hat OpenJDK, and Azul Platform Prime (Zing). Find top-ranking free & paid apps similar to OpenJDK 11 (Java 11) on CentOS 8 for your AWS Marketplace Software needs.
Address   100 S Wacker DrSTE 600, 60606, Chicago
🌐
Igor Oseledko
igoroseledko.com › home › sysadmin › commands & shells › installing alternative java versions on rhel/centos
Installing Alternative Java Versions on RHEL/CentOS
October 9, 2023 - # Set version, update, and filename v="jdk1.8.0_101" r="8u101-b13" f="jdk-8u101-linux-x64.tar.gz" cd /opt wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http://www.oracle.com/; oraclelicense=accept-securebackup-cookie" \ "http://download.oracle.com/otn-pub/java/jdk/${r}/${f}" tar xzf ${f} && /bin/rm -f ${f} cd /opt/${v} alternatives --install /usr/bin/java java /opt/${v}/bin/java 2 alternatives --install /usr/bin/jar jar /opt/${v}/bin/jar 2 alternatives --install /usr/bin/javac javac /opt/${v}/bin/javac 2 alternatives --set jar /opt/${v}/bin/jar alternatives --set javac /opt/${v}/bin/javac export JAVA_HOME=/opt/${v} export JRE_HOME=/opt/${v}/jre export PATH=$PATH:/opt/${v}/bin:/opt/${v}/jre/bin cat >> /etc/environment << EOF JAVA_HOME=/opt/${v} JRE_HOME=/opt/${v}/jre PATH=$PATH:/opt/${v}/bin:/opt/${v}/jre/bin EOF
Find elsewhere
🌐
CentOS
wiki.centos.org › HowTos(2f)Java(2f)OpenJDKOnCentOS.html
HowTos/Java/OpenJDKOnCentOS
This HowTo will explain how to install and configure OpenJDK on CentOS. This section will briefly discuss OpenJDK licensing issues. This section will cover Java alternatives for CentOS and will at least cover GCJ and mention the previous HowTo HowTos/JavaOnCentOS that covers installing Sun and IBM JDKs.
🌐
Qiita
qiita.com › java
CentOS7系+JDK-9.0.1+JDK1.8.0+alternativesで切り替え - Qiita
January 9, 2018 - [root@asianux7 ~]# alternatives --config java 5 プログラムがあり 'java' を提供します。 選択 コマンド ----------------------------------------------- 1 java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151-2.6.11.1.el7_4.x86_64/jre/bin/java) * 2 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el7_4.x86_64/jre/bin/java) + 3 /usr/java/jdk-9.0.1/bin/java 4 /usr/java/jdk1.8.0_152/jre/bin/java 5 /usr/java/jdk1.8.0_152/bin/java Enter を押して現在の選択 [+] を保持するか、選択番号を入力します: [root@asianux7 ~]# java -version java version "9.0.1" Java(TM) SE Runtime Environment (build 9.0.1+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
🌐
Biowiki
biowiki.org › wiki › index.php › Centos_Alternatives
Centos Alternatives - Biowiki
January 1, 2017 - 1) Install your application wherever you want, /nfs/src/jdk1.6.0_04/jre/bin/java in this case · 2) (Note: you should be root or equiv for the following) Run the command: /usr/sbin/alternatives --install /usr/bin/java java /nfs/src/jdk1.6.0_04/jre/bin/java 10 --slave /usr/bin/rmiregistry rmiregistry /nfs/src/jdk1.6.0_04/bin/rmiregistry --slave /usr/lib/jvm/jre jre /nfs/src/jdk1.6.0_04/jre
🌐
Rocky Linux Forum
forums.rockylinux.org › rocky linux help & support
Centos 8 -> Rocky Linux -> Java alternatives missing - Rocky Linux Help & Support - Rocky Linux Forum
September 22, 2021 - I migrated some machines from Centos 8.x to RockyLinux 8.4 with the script migrate2rocky.sh (Migrating To Rocky Linux - Documentation), and generally, all goes well. But in some servers, I use various versions of Java, and before to migrate I can use the command alternatives to choose the java ...
🌐
CentOS
wiki.centos.org › HowTos › JavaDevelopmentKit
How to install the Java Development Kit from Java.com
# alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_27/jre/bin/java 3 \ --slave /usr/bin/javaws javaws /usr/java/jdk1.6.0_27/jre/bin/javaws \ --slave /usr/lib/mozilla/plugins/libnpjp2.so libnpjp2.so /usr/java/jdk1.6.0_27/jre/lib/i386/libnpjp2.so \ --slave /usr/bin/javac java /usr/java/jdk1.6.0_27/bin/javac \ --slave /usr/bin/jar jar /usr/java/jdk1.6.0_27/bin/jar
🌐
TecAdmin
tecadmin.net › install-java-8-on-centos-rhel-and-fedora
How to Install Java 8 on CentOS/RHEL 9/8 and Fedora
April 26, 2025 - I’m trying to perform the same steps in a shell script on CentOS 7. I’. using “expect” to set the specific Java version but no luck. Have you been successful in setting the Java version with “expect” to set the value when executing: alternatives –config java This command opens an interactive subshell that requires the user to select a numerical value for the Java version.
🌐
MyDreams
mydreams.cz › mydreams vps hosting › wiki › setting up centos 7 for automatic switching between multiple java versions using alternatives system
Setting up CentOS 7 for Automatic Switching Between Multiple Java - 🚀 VPS Hosting, Webhosting a Dedikované Servery
April 5, 2024 - For example, to install OpenJDK 8 and OpenJDK 11: sudo yum install java-1.8.0-openjdk sudo yum install java-11-openjdk ... The 'alternatives' system allows you to manage different Java versions by setting symbolic links for each version.
🌐
CodingTechRoom
codingtechroom.com › question › -centos-7-java-alternatives-list
How to Retrieve the Java Alternatives List on CentOS 7 - CodingTechRoom
To list Java alternatives, use the command: alternatives --config java. In CentOS 7, multiple versions of Java can be installed simultaneously. The alternatives system allows you to manage these versions effectively.
🌐
OpenNMS Community
opennms.discourse.group › knowledge base
Dealing with Java Environments on CentOS and Ubuntu - Knowledge Base - OpenNMS Community
July 2, 2024 - A working Java environment is crucial for running OpenNMS services and there are many ways how to set up a Java environment. This guide explains how you can use the tools coming with CentOS 7 and Ubuntu 18 LTS to control and troubleshoot your Java environment on a server with a CLI. ℹ For OpenNMS Horizon it is required to have OpenJDK Development Kit installed which is named java-11-openjdk-devel on CentOS and on Ubuntu openjdk-11-jdk.
🌐
The Geek Diary
thegeekdiary.com › how-to-work-with-multiple-java-versions-under-linux
How to work with multiple java versions under Linux
GitLab CI/CD is a tool used for automating the process of testing, building, and deploying code. It helps developers integrate and deliver software quickly and reliably. Here’s a breakdown of the p · © 2025 Sandeep. Some rights reserved
🌐
Igalia
blogs.igalia.com › dpino › 2011 › 10 › 13 › configuring-different-jdks-with-alternatives
Configuring different JDKs with alternatives - Unweaving the Web
What the hell means each parameter? This is pretty obscure if you don’t really understand what’s the purpose of the ‘*alternatives*‘ program. ... * as *‘java’*, then when later we do: ‘*alternatives –config java*‘, the alternatives for ‘*java*‘ will be listed.
🌐
Red Hat
access.redhat.com › solutions › 6232511
How to set default Java version with alternatives tool in RHEL on a per user basis - Red Hat Customer Portal
1 week ago - Selection Command ------------... /var/lib/alternatives/java.new: Permission denied Using the alternatives tool allows you to set the system default version as root but does not currently provide options to set different defaults for ...