Utilizzo del Toolkit per il download di Java

Questo argomento mostra come utilizzare il Toolkit per il download Java per installare una release Oracle Java in Oracle Cloud Shell.

Prima di iniziare

Per utilizzare il toolkit, assicurarsi che:

  • Hai effettuato l'accesso al tuo account Oracle Cloud Infrastructure (OCI).
  • È stata avviata Cloud Shell nella console OCI.

Passo 1: esecuzione dello script del toolkit

Nella sessione Cloud Shell eseguire lo script del toolkit:
jms-java-download.sh
Output di esempio:
<username>@cloudshell:jms (oci_region_id)$ jms-java-download.sh 
Fetching Java releases.
Current Java Versions:
    Version         Type       Security status      Release date         EOSL date            Release notes                           
1)  24.0.1          CPU        UP_TO_DATE           Apr 15, 2025         Sep 18, 2025         https://www.oracle.com/java/technologies/javase/24-0-1-relnotes.html
2)  21.0.7          CPU        UP_TO_DATE           Apr 15, 2025         Sep 19, 2031         https://www.oracle.com/java/technologies/javase/21-0-7-relnotes.html
3)  17.0.15         CPU        UP_TO_DATE           Apr 15, 2025         Sep 18, 2029         https://www.oracle.com/java/technologies/javase/17-0-15-relnotes.html
4)  11.0.27         CPU        UP_TO_DATE           Apr 15, 2025         Jan 30, 2032         https://www.oracle.com/java/technologies/javase/11-0-27-relnotes.html
5)  1.8.0_451       CPU        UP_TO_DATE           Apr 15, 2025         Dec 31, 2030         https://www.oracle.com/java/technologies/javase/8u451-relnotes.html
6)  Show Archived Versions
Enter the number corresponding to the version to install (or 6 to view archived versions):

Passo 2: selezionare una versione Java

È possibile effettuare le operazioni riportate di seguito.
  • Selezionare una release corrente oppure
  • Scegliere l'opzione denominata "Mostra versioni archiviate" per visualizzare le release precedenti.
Nota

Il numero di opzione per le versioni archiviate può variare a seconda del numero di versioni correnti elencate.

Selezione di una release corrente

Se la versione Java che si desidera installare è elencata nelle release correnti, immettere il numero corrispondente. In questo modo si procederà al passo 3: Gestione token.

Visualizzazione delle versioni archiviate
Nota

Le release non correnti nella tabella Release archiviate vengono fornite per aiutare gli sviluppatori a eseguire il debug dei problemi nei sistemi precedenti. Non vengono aggiornati con le patch di sicurezza più recenti e non sono consigliati per l'uso in produzione.
Se si sceglie "Mostra versioni archiviate", il toolkit elencherà le principali versioni Java disponibili con release archiviate:
Enter the number corresponding to the version to install (or 6 to view archived versions): 6
JDK major versions:
1)  24                  
2)  23                  
3)  22                  
4)  21                  
5)  20                  
6)  17                  
7)  11                  
8)  8
Enter the number corresponding to the JDK version to view archived versions:
Scegliere la versione principale di JDK a cui si è interessati.
Enter the number corresponding to the JDK version to view archived versions: 7
Archived Java 11 Versions:
    Version         Type       Security status      Release date         EOSL date            Release notes                           
1)  11.0.26         CPU        UPDATE_REQUIRED      Jan 21, 2025         Jan 30, 2032         https://www.oracle.com/java/technologies/javase/11-0-26-relnotes.html
2)  11.0.25         CPU        UPDATE_REQUIRED      Oct 15, 2024         Jan 30, 2032         https://www.oracle.com/java/technologies/javase/11-0-25-relnotes.html
3)  11.0.24         CPU        UPDATE_REQUIRED      Jul 16, 2024         Jan 30, 2032         https://www.oracle.com/java/technologies/javase/11-0-24-relnotes.html
4)  11.0.23         CPU        UPDATE_REQUIRED      Apr 16, 2024         Jan 30, 2032         https://www.oracle.com/java/technologies/javase/11-0-23-relnotes.html
5)  11.0.22         CPU        UPDATE_REQUIRED      Jan 16, 2024         Jan 30, 2032         https://www.oracle.com/java/technologies/javase/11-0-22-relnotes.html
6)  11.0.21         CPU        UPDATE_REQUIRED      Oct 17, 2023         Jan 30, 2032         https://www.oracle.com/java/technologies/javase/11-0-21-relnotes.html
7)  11.0.20         CPU        UPDATE_REQUIRED      Jul 18, 2023         Jan 30, 2032         https://www.oracle.com/java/technologies/javase/11-0-20-relnotes.html
8)  11.0.19         CPU        UPDATE_REQUIRED      Apr 18, 2023         Jan 30, 2032         https://www.oracle.com/java/technologies/javase/11-0-19-relnotes.html
Enter the number corresponding to the version to install:

Passo 3: Gestione dei token

Ogni download Java tramite il toolkit deve essere associato a un token valido gestito dalla funzione di download Java in JMS.

  • Se esiste già un token valido, è possibile riutilizzarlo.
  • Se non viene trovato alcun token adatto, il toolkit consente di crearne uno nuovo durante il processo di installazione.

Caso 1: token attivo esistente

Se esistono già uno o più token validi, il toolkit chiederà di riutilizzare un token esistente o di crearne uno nuovo:
Enter the number corresponding to the version to install (or 6 to view archived versions): 1
Use an existing download token? (Y/N): Y
Active Tokens for Java Version 24 with license type NFTC:
    Name                  Description                    License Type Expiry        Created By    OCID
1)  JDK24NFTCToken        Token for downloading JDK 24   NFTC         Sep 18, 2027  <username>    {token_ocid}

Enter the number corresponding to the token to use or enter 'N' to create a new token: 1

Caso 2: creazione nuovo token o assenza di token attivo

L'esempio mostra JDK 24.0.1, che rientra in Oracle No-Fee Terms and Conditions (NFTC):

Enter the number corresponding to the version to install (or 6 to view archived versions): 1
No active tokens found for Java version 24. Creating a new token.

JDK 24 is licensed under Oracle No-Fee Terms and Conditions (NFTC).
Read the full agreement here: https://java.com/freeuselicense

Enter details for new Java Download token.
Enter name (max 64 characters): JDK24NFTCToken
Enter description (max 255 characters): Token for downloading JDK 24 releases
Enter expiry date (UTC) (YYYY-MM-DD, leave blank for default: 2025-09-18. Minimum: 2025-05-20, Maximum: 2027-09-18): 2027-09-18
Nota

Se la release selezionata viene distribuita in base al Contratto di licenza di Oracle Technology Network per la licenza Oracle Java SE (OTN), verrà richiesto di accettare le condizioni di licenza prima di poter creare un token e avviare il download.

Una volta selezionato o creato un token, il download inizia automaticamente.

Passo 4: Download e installazione completa

Se l'istanza di Cloud Shell dispone già di un'installazione Oracle Java, il toolkit lo rileva e chiede se rimuovere le directory JDK esistenti:

The following JDK directories were found in /home/<username>/jms-java-download:
/home/<username>/jms-java-download/jdk-24.0.1
Current available space: 4673 MB.
Estimated space needed: 660 MB.
Do you want to remove all existing JDK directories? (Y/N):

Una volta confermato (o saltato), il download inizia:

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
100  229M  100  229M    0     0  74.5M      0  0:00:03  0:00:03 --:--:--  123M

Al completamento dell'installazione, il toolkit aggiorna automaticamente le variabili di ambiente e termina l'esecuzione.

JAVA_HOME and PATH updated in /home/<username>/.java_env.
Run 'source ~/.bashrc' to apply changes.

Il processo di installazione viene completato in Oracle Cloud Shell. È ora possibile iniziare a utilizzare immediatamente la versione Java installata.

Per verificare l'installazione, eseguire:

java --version