此内容没有您所选择的语言版本。

2.3.3. Installation Procedures


Procedure 2.3. Installing Java

Follow this procedure to install and set up a supported Java version:
  1. Subscribe your system to the appropriate channel:
    • Red Hat Enterprise Linux Server Supplementary for Red Hat Enterprise Linux 7
    • Red Hat Enterprise Linux Server Supplementary for Red Hat Enterprise Linux 6
    • Red Hat Enterprise Linux Supplementary for Red Hat Enterprise Linux 5
  2. On the command line, as the root user run the command to install Java 1.6 or 1.7:
    • On Red Hat Enterprise Linux 5, Red Hat Enterprise Linux 6, and Red Hat Enterprise Linux 7, execute the yum install command to install Java 1.6:
      # yum install java-1.6.0-<VENDOR>-devel
      Substitute <VENDOR> with sun, ibm, or openjdk.
      Execute the following variation of the listed command to install Java 1.7:
      # yum install java-1.7.0-<VENDOR>-devel
      Substitute <VENDOR> with oracle, ibm, or openjdk.
  3. Run the following commands as the root user (if switching from another user, make sure to run the command su -) to make sure the correct JDK is in use:
    # alternatives --config java
    # alternatives --config javac
    These commands return lists of available JDK versions with the version in use marked with a plus (+) sign. If the set JDK is not the desired option, switch to the right JDK as instructed on the command line.

    Important

    Any software that makes use of the java and javac commands is using the JDK set by alternatives. Switching java alternatives may negatively influence running of such software.
  4. Install the required packages (see Section 2.3.2, “ZIP Installation Prerequisites”)
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部