Questo contenuto non è disponibile nella lingua selezionata.

Chapter 4. Selecting a system-wide archive Red Hat build of OpenJDK version


If you have multiple versions of Red Hat build of OpenJDK installed with the archive on RHEL, you can select a specific Red Hat build of OpenJDK version to use system-wide.

Prerequisites

  • Know the locations of the Red Hat build of OpenJDK versions installed using the archive.

Procedure

To specify the Red Hat build of OpenJDK version to use for a single session:

  1. Configure JAVA_HOME with the path to the Red Hat build of OpenJDK version you want used system-wide.

    $ export JAVA_HOME=/opt/jdk/openjdk-17.0.0.0.35

  2. Add $JAVA_HOME/bin to the PATH environment variable.

    $ export PATH="$JAVA_HOME/bin:$PATH"

To specify the Red Hat build of OpenJDK version to use permanently for a single user, add these commands into ~/.bashrc:

export JAVA_HOME=/opt/jdk/openjdk-17.0.0.0.35
export PATH="$JAVA_HOME/bin:$PATH"

To specify the Red Hat build of OpenJDK version to use permanently for all users, add these commands into /etc/bashrc:

export JAVA_HOME=/opt/jdk/openjdk-17.0.0.0.35
export PATH="$JAVA_HOME/bin:$PATH"
Note

If you do not want to redefine JAVA_HOME, add only the PATH command to bashrc, specifying the path to the Java binary. For example, export PATH="/opt/jdk/openjdk-17.0.0.0.35/bin:$PATH".

Additional resources

Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2026 Red Hat
Torna in cima