Hispanitat nº 7 Local C

08225, Terrassa (Barcelona)

+34 600 676 872

Soporte Técnico

Lunes-Viernes: 9:30 a 13:30 - 16:30 a 20:00

Sábados a convenir

Por favor, o Regístrate para crear mensajes y debates.

instalacion de java

2.2. Installing a JRE on RHEL using an archive

You can install OpenJDK Java Runtime Environment (JRE) using an archive. This is useful if the Java administrator does not have root privileges.

Note

To ease the upgrades for later versions create a parent directory to contain your JREs and create a symbolic link to the latest JRE using a generic path.

Procedure

  1. Download the latest version of the JRE archive for Linux.
  2. Extract the contents of the archive to a directory of your choice:

    $ mkdir ~/jres
    $ cd ~/jres
    $ java-17-openjdk-17.0.2.0.8-3.portable.jre.el.x86_64.tar.xz
  3. Create a generic path by using symbolic links to your JRE for easier upgrades:

    $ ln -s ~/jres/java-17-openjdk-17.0.2.0.8-3.portable.jre.el.x86_64 ~/jres/java-17
  4. Configure the JAVA_HOME environment variable:

    $ export JAVA_HOME=~/jres/java-17
  5. Verify that JAVA_HOME environment variable is set correctly:

    $ printenv | grep JAVA_HOME
    JAVA_HOME=~/jres/java-17
    Note

    When installed using this method, Java will only be available for the current user.

  6. Add the bin directory of the generic JRE path to the PATH environment variable:

    $ export PATH="$JAVA_HOME/bin:$PATH"
  7. Verify that java -version works without supplying the full path:

    $ java -version
    openjdk version "17" 2021-10-19
    OpenJDK Runtime Environment 21.9 (build 17+35)
    OpenJDK 64-Bit Server VM 21.9 (build 17+35, mixed mode, sharing)
    Note

    You can ensure that JAVA_HOME environment variable persists for the current user by exporting the environment variable in ~/.bashrc.

WhatsApp chat