Unable to install openJDK 8 in Red Hat

微笑、不失礼 提交于 2019-12-10 18:21:56

问题


I am trying to install openJDK 8 in my machine using yum, as per this https://openjdk.java.net/install/ .

But I can't see open openJDK 8 in yum repository.

[root@test ~]# yum search jdk
Loaded plugins: downloadonly, product-id, refresh-packagekit, security,
              : subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
=============================== N/S Matched: jdk ===============================
java-1.6.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.6.0-openjdk-javadoc.x86_64 : OpenJDK API Documentation
java-1.7.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
icedtea-web.x86_64 : Additional Java components for OpenJDK - Java browser
                   : plug-in and Web Start implementation
ldapjdk.x86_64 : The Mozilla LDAP Java SDK

yum.conf file:

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools

回答1:


If your version is too old you don't have the packages included or you have to enable some more repositories first to get the packages.

To list enabled repos:

subscription-manager repos --list-enabled

To enable third party repo:

subscription-manager repos --enable rhel-7-server-optional-rpms

When your version isn't to old you can make an yum update and fetch all new packages. Then you should be able to install JDK 8. Here is another good tutorial how to install JDK-8 on Red-Hat.

https://developers.redhat.com/articles/using-java-rhel-7-openjdk-8/

If you use an older Red-Hat version you have to install it on your own.

https://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/



来源:https://stackoverflow.com/questions/54004627/unable-to-install-openjdk-8-in-red-hat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!