简体   繁体   中英

How to install OpenJDK Java 11 on a RHEL 7.2 server

I am not able to install openjdk11 on RHEL 7.2.

I have tried as

**yum install java-11-openjdk-devel**
Loaded plugins: product-id, search-disabled-repos, subscription-manager
                                                                                                                                   | 2.1 kB  00:00:00
rhel-7-server-eus-optional-rpms                                                                                                                                                         | 1.8 kB  00:00:00
rhel-7-server-eus-rpms                                                                                                                                                                  | 2.0 kB  00:00:00
rhel-7-server-eus-supplementary-rpms                                                                                                                                                    | 1.8 kB  00:00:00
rhel-7-server-extras-rpms                                                                                                                                                               | 2.0 kB  00:00:00
rhel-7-server-optional-rpms                                                                                                                                                             | 1.8 kB  00:00:00
rhel-7-server-rh-common-rpms                                                                                                                                                            | 2.1 kB  00:00:00
rhel-7-server-rpms                                                                                                                                                                      | 2.0 kB  00:00:00
rhel-7-server-satellite-tools-6.9-rpms                                                                                                                                                  | 2.1 kB  00:00:00
rhel-7-server-supplementary-rpms                                                                                                                                                        | 2.0 kB  00:00:00
**No package java-11-openjdk-devel available**.
**Error: Nothing to do**

Thanks in Advance.

You should be able to get the RPM via the RHEL 7.x package repository, but maybe you don't have access to that repository. (Access it restricted to people / organizations with a RHEL license, I think.) If you do, the yum install approach should work.

You can also find RPMs for OpenJDK Java using https://rpmfind.net . For example:

The rpmfind site doesn't list any RHEL endorsed packages, but the CentOS 7.x packages should be compatible with RHEL 7.2. Or you could upgrade 1 RHEL.

After downloading (eg using wget ) you can manually install an RPM using

sudo rpm -i example_file.rpm

or

sudo yum localinstall example_file.rpm

The downside of a local install is that yum won't be able to upgrade it for you. You will need to repeat the above steps each time there is a new patch release for Java 11.


1 - I suspect that if you upgraded your OS to the latest RHEL 7.x release or an 8.x release, you would be able to install OpenJDK Java 11 from the RHEL package repos.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM