Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Per continuare a ricevere aggiornamenti della sicurezza e poter usufruire dell'assistenza tecnica, devi eseguire l'upgrade delle tue applicazioni alla versione di runtime supportata più recente.
Il processo di upgrade di un'app esistente dipende dalla versione di runtime attualmente utilizzata dall'app:
Java 8: devi eseguire la migrazione dell'app all'ultima versione Java supportata. Il 31 gennaio 2024 è terminato il supporto di Java 8. Le tue applicazioni Java 8 esistenti continueranno a essere eseguite e a ricevere traffico. Tuttavia,
non puoi eseguire il deployment di nuove applicazioni o aggiornare quelle esistenti che utilizzano i runtime dopo la data di fine del supporto.
Runtime Java di seconda generazione (dopo il termine dell'assistenza): per eseguire l'upgrade a una
versione di Java supportata,
segui questi passaggi:
Aggiorna il file app.yaml specificando la versione di Java in cui vuoi eseguire la tua app. Ad esempio:
runtime:javaVERSION
dove VERSION è il numero di versione MAJOR.
Ad esempio, per utilizzare la versione Java più recente, Java 21,
specifica 21.
Per ulteriori informazioni, consulta la panoramica del runtime Java.
Se utilizzi servizi in bundle precedenti, devi eseguire l'upgrade delle app in modo che vengano eseguite su:
Java Enterprise Edition 10 (EE10, predefinito, consigliato): Java EE10
non supporta le API javax.servlet.* e richiede di aggiornare
le app e le dipendenze di terze parti per utilizzare elementi Java più recenti
come lo spazio dei nomi Jakarta.
Java Enterprise Edition 8 (EE8): Java EE8 ti consente di utilizzare le API javax.servlet.*, ma devi apportare piccole modifiche alla configurazione del file appengine-web.xml.
App Engine supporta questa versione. Per continuare a eseguire l'upgrade alla
versione supportata più recente:
Aggiorna il file app.yaml specificando la versione di Java in cui vuoi eseguire la tua app. Ad esempio:
runtime:javaVERSION
dove VERSION è il numero di versione MAJOR.
Ad esempio, per utilizzare la versione Java più recente, Java 21,
specifica 21.
Per ulteriori informazioni, consulta la panoramica del runtime Java.
Se utilizzi servizi in bundle precedenti, devi eseguire l'upgrade delle app in modo che vengano eseguite su:
Java Enterprise Edition 10 (EE10, predefinito, consigliato): Java EE10
non supporta le API javax.servlet.* e richiede di aggiornare
le app e le dipendenze di terze parti per utilizzare elementi Java più recenti
come lo spazio dei nomi Jakarta.
Java Enterprise Edition 8 (EE8): Java EE8 ti consente di utilizzare le API javax.servlet.*, ma devi apportare piccole modifiche di configurazione al file appengine-web.xml.
Consulta la tabella seguente per capire quali versioni di Java sono compatibili con le tue versioni di servlet:
Enterprise Edition (EE)
Versione Java
Servlet
Compatibilità
EE7
11
2.5 o 3.1
Non è disponibile assistenza della community per EE7. Java 11 ha raggiunto la fine del supporto. Ti consigliamo di eseguire l'upgrade dell'app per utilizzare la versione più recente di Java.
EE7
17
2.5 o versioni successive
Non è disponibile assistenza della community per EE7. Ti consigliamo di eseguire l'upgrade dell'app per utilizzare EE8.
6.0 (opzione consigliata). Java 21 è configurato per eseguire EE10 per impostazione predefinita.
Per utilizzare Java EE10, devi aggiornare i servlet e le dipendenze dell'applicazione in modo da includere lo spazio dei nomi Jakarta. Per ulteriori informazioni, vedi Eseguire l'upgrade di Java 21 su EE10.
Eseguire l'upgrade a Java 21 su EE10
Per utilizzare Java 21 su Enterprise Edition 10 (EE10),
devi eseguire l'upgrade dei servlet e delle dipendenze dell'applicazione nei file Maven e Gradle
in modo da includere lo spazio dei nomi Jakarta:
Modifica il numero di versione nel file di configurazione web.xml in version=6.0. Ad esempio:
(Facoltativo) Java 21 include il supporto per i thread virtuali. Per attivare i thread virtuali, aggiungi la proprietà appengine.use.virtualthreads al tag system-properties nel file appengine-web.xml.
Esegui l'upgrade a Java 17 o 21 su EE8
Puoi continuare a utilizzare le API javax.servlet.* su Java EE8 senza modifiche sostanziali alla configurazione dell'applicazione, perché EE8 offre compatibilità con le versioni precedenti per Java EE6 e versioni successive. Per eseguire le applicazioni su Java EE8, devi dichiarare un nuovo
system-properties tag nel
appengine-web.xml
file con la configurazione app.engine.use.EE8 non predefinita:
(Facoltativo) Java 21 include il supporto per i thread virtuali. Per attivare i thread virtuali, aggiungi la proprietà appengine.use.virtualthreads all'interno del tag system-properties. Esempio:
<property name="appengine.use.virtualthreads" value="true"/>
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eApplications must be upgraded to the latest supported Java runtime version to receive security updates and technical support.\u003c/p\u003e\n"],["\u003cp\u003eJava 8 applications have reached end of support and while they will continue to run, new deployments or updates to Java 8 applications are not permitted.\u003c/p\u003e\n"],["\u003cp\u003eUpgrading to a supported Java version involves updating the \u003ccode\u003eapp.yaml\u003c/code\u003e file to specify the desired Java version, such as Java 21, by using the \u003ccode\u003eruntime: javaVERSION\u003c/code\u003e configuration.\u003c/p\u003e\n"],["\u003cp\u003eIf using legacy bundled services, applications must be upgraded to either Java Enterprise Edition 10 (EE10), which requires using the \u003ccode\u003eJakarta\u003c/code\u003e namespace, or Java Enterprise Edition 8 (EE8), which requires minor \u003ccode\u003eappengine-web.xml\u003c/code\u003e configuration changes to use \u003ccode\u003ejavax.servlet.*\u003c/code\u003e APIs.\u003c/p\u003e\n"],["\u003cp\u003eJava 21 supports virtual threads, which can be enabled by adding the \u003ccode\u003eappengine.use.virtualthreads\u003c/code\u003e property in the \u003ccode\u003eappengine-web.xml\u003c/code\u003e file.\u003c/p\u003e\n"]]],[],null,["# Upgrade an existing application\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\nYou must upgrade your applications to the [latest supported runtime version](/appengine/docs/standard/lifecycle/support-schedule#java) to continue receiving security updates\nand be eligible for technical support.\n\nThe process of upgrading an existing app depends on the runtime version that\nyour app currently uses:\n\n- **Java 8** : You must migrate your app to the [latest supported Java version](/appengine/docs/standard/lifecycle/support-schedule#java). Java 8 has reached [end of support](/appengine/docs/standard/lifecycle/runtime-lifecycle#end_of_support) on January 31,2024. Your\n existing Java 8 applications will continue to run and receive traffic. However,\n you cannot deploy new or update existing applications that use runtimes [after their end of support date](/appengine/docs/standard/lifecycle/support-schedule#java).\n\n- **Java second-generation runtimes (after end of support)** : To upgrade to a\n [supported version of Java](/appengine/docs/standard/lifecycle/support-schedule#java),\n do the following:\n\n - Update the `app.yaml` file by specifying a version of Java that you want your\n app to run. For example:\n\n runtime: java\u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e\n\n Where \u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e is the `MAJOR` version number.\n For example, to use the latest Java version, Java 21,\n specify `21`.\n For more information, see the\n [Java runtime overview](/appengine/docs/standard/java-gen2/runtime).\n - If you use legacy bundled services, you must upgrade your apps to run\n on either:\n\n - Java Enterprise Edition 10 (EE10 - default, recommended): Java EE10\n does not support `javax.servlet.*` APIs and requires you to update\n your apps and third-party dependencies to use newer Java artifacts\n like the `Jakarta` namespace.\n\n - Java Enterprise Edition 8 (EE8): Java EE8 lets you use `javax.servlet.*`\n APIs, but you must make minor configuration changes\n to your `appengine-web.xml` file.\n\n See [Upgrade to Java 21 for legacy bundled services](#update_for_bundled_services) for all options.\n- **Java 17**:\n\n App Engine supports this version. To continue to upgrade to the\n latest support version, do the following:\n - Update the `app.yaml` file by specifying a version of Java that you want your\n app to run. For example:\n\n runtime: java\u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e\n\n Where \u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e is the `MAJOR` version number.\n For example, to use the latest Java version, Java 21,\n specify `21`.\n For more information, see the\n [Java runtime overview](/appengine/docs/standard/java-gen2/runtime).\n - If you use legacy bundled services, you must upgrade your apps to run\n on either:\n\n - Java Enterprise Edition 10 (EE10 - default, recommended): Java EE10\n does not support `javax.servlet.*` APIs and requires you to update\n your apps and third-party dependencies to use newer Java artifacts\n like the `Jakarta` namespace.\n\n - Java Enterprise Edition 8 (EE8): Java EE8 lets you use\n `javax.servlet.*` APIs, but you must make minor configuration changes\n to your `appengine-web.xml` file.\n\n See [Upgrade to Java 21 for legacy bundled services](#update_for_bundled_services) for all options.\n\nUpgrade to Java 21 for legacy bundled services\n----------------------------------------------\n\n| **Important:** The `javax.servlet.*` APIs reached the [end of community support](https://github.com/jetty/jetty.project/issues/7958). We recommend that you update to [EE10](#ee10).\n\n### Java runtime compatibility\n\nRefer to the following table to understand which Java versions are compatible\nwith your versions of servlet:\n\n### Upgrade to Java 21 on EE10\n\nTo use Java 21 on [Enterprise Edition 10 (EE10)](https://jakarta.ee/release/10/),\nyou must upgrade your application servlets and dependencies in your Maven and Gradle\nfiles to include the `Jakarta` namespace:\n\n1. Change the version number in your `web.xml` configuration file to `version=6.0`. For example:\n\n \u003cweb-app xmlns=\"https://jakarta.ee/xml/ns/jakartaee\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd\"\n version=\"6.0\"\u003e\n ...\n \u003c/web-app\u003e\n\n2. Rename your application servlets and dependencies from `javax.servlet.*` to\n `jakarta.servlet.*`:\n\n import jakarta.servlet.ServletException;\n import jakarta.servlet.annotation.WebServlet;\n import jakarta.servlet.http.Cookie;\n import jakarta.servlet.http.HttpServlet;\n import jakarta.servlet.http.HttpServletRequest;\n import jakarta.servlet.http.HttpServletResponse;\n\n @WebServlet(name = \"viewer\", urlPatterns = {\"/view\"})\n public class MyServlet extends HttpServlet {\n ......\n\n3. Update your remaining application third-party dependencies to newer Java artifacts\n depending on the `Jakarta` namespace.\n\n4. Add the following system property in your [`appengine-web.xml`](/appengine/docs/standard/java-gen2/config/appref-xml#system_properties) file:\n\n \u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n \u003cappengine-web-app xmlns=\"http://appengine.google.com/ns/1.0\"\u003e\n \u003cruntime\u003ejava21\u003c/runtime\u003e \u003c!-- or java17 --\u003e\n \u003csystem-properties\u003e\n \u003cproperty name=\"appengine.use.EE10\" value=\"true\"/\u003e\n \u003c/system-properties\u003e\n \u003capp-engine-apis\u003etrue\u003c/app-engine-apis\u003e\n \u003c/appengine-web-app\u003e\n\n5. Optional: Java 21 includes support for virtual threads. To enable\n virtual threads, you add the\n `appengine.use.virtualthreads` property within the `system-properties` tag\n in your [`appengine-web.xml`](/appengine/docs/standard/java-gen2/config/appref-xml#system_properties)\n file.\n\n### Upgrade to Java 17 or 21 on EE8\n\nYou can continue using `javax.servlet.*` APIs on Java EE8 without major application\nconfiguration changes, because EE8 offers backward compatibility for Java EE6\nand later. To run your applications on Java EE8, you must declare a new\n`system-properties` tag in your\n[`appengine-web.xml`](/appengine/docs/standard/java-gen2/config/appref-xml#system_properties)\nfile with the non-default `app.engine.use.EE8` configuration: \n\n \u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n \u003cappengine-web-app xmlns=\"http://appengine.google.com/ns/1.0\"\u003e\n \u003cruntime\u003ejava21\u003c/runtime\u003e \u003c!-- or java17 --\u003e\n \u003csystem-properties\u003e\n \u003cproperty name=\"appengine.use.EE8\" value=\"true\"/\u003e\n \u003c/system-properties\u003e\n \u003capp-engine-apis\u003etrue\u003c/app-engine-apis\u003e\n \u003c/appengine-web-app\u003e\n\nOptional: Java 21 includes support for virtual threads. To enable\nvirtual threads, you add the `appengine.use.virtualthreads` property\nwithin the `system-properties` tag. Example:\n`\u003cproperty name=\"appengine.use.virtualthreads\" value=\"true\"/\u003e`"]]