Upgrade an existing application

Upgrade your applications to thelatest supported runtime version to continue receiving security updatesand be eligible for technical support.

The process of upgrading an existing application depends on the runtime versionthat your application uses:

  • Java 8: Migrate your application to thelatest supported Javaversion. Java 8has reachedend ofsupporton January 31, 2024 and will be deprecated on January 31, 2026. Afterdeprecation, you won't be able to deploy Java 8 applications, even if yourorganization previously used an organization policy to re-enable deploymentsof legacy runtimes. Your existing Java 8 applications will continue to runand receive trafficafter their deprecationdate.

  • Java 11: Upgrade your application to thelatest supported Javaversion. Java 11has reachedend ofsupporton October 31, 2024 and will be deprecated on October 31, 2025. Afterdeprecation, you won't be able to deploy Java 11 applications. Your existingJava 11 applications will continue to runand receive trafficafter their deprecationdate.

  • Supported second-generation runtimes (Java 17 and Java 21):

    App Engine supports second-generation Java runtime versions, such as Java 17and Java 21. Toupgrade to Java 25 (preview), do the following:

    • Update theapp.yaml file by specifying a version of Java that you want yourapp to run. For example:

      runtime:javaVERSION

      WhereVERSION is theMAJOR version number.For example, to use the latest Java version, Java 25 (preview),specify25.For more information, see theJava runtime overview.

    • If you use legacy bundled services, upgrade your applications to runon either:

      • Java Enterprise Edition 11 (E11): EE 11 doesn't supportjavax.servlet.* APIsand requires you to update your applications and third-party dependenciesto use newer Java artifacts like theJakarta namespace. Java 25 (preview)by default runs on EE 11 and doesn't support EE 10.

      • Java Enterprise Edition 8 (EE 8): Java EE 8 lets you usejavax.servlet.* APIs, but you must make minor configuration changesto yourappengine-web.xml file.

Upgrade to a supported Java version for legacy bundled services

Important: Thejavax.servlet.* APIs reached theend of community support. We recommend that you update yourJava on a compatible Enterprise Edition version.

Java runtime compatibility

Refer to the following table to understand which Java versions are compatiblewith your versions of servlet.For more details on the entry-point features, system property configurations,resulting Jetty support, and compatible EE Versions, seeEntry Point Features.

Enterprise Edition (EE)Java versionServletCompatibility
EE7112.5 or 3.1There is no community support for EE7. Java 11 has reachedend of support. We recommend that you upgrade your app to use thelatest version of Java.
EE7172.5 or laterThere is no community support for EE7. We recommend that you upgrade your app to use EE 8 and later versions.
EE 817/21/25 (preview)2.5 and laterJava EE 8 is backward compatible with Java EE6 and later. For more information, seeUpgrade Java on a compatible Enterprise Edition (EE) version.
EE 1017/216.0 (default, recommended). Java 21 is configured to run EE 10 by default.To use Java EE 10, update your application servlets and dependencies to include theJakarta namespace. For more information, seeUpgrade Java on a compatible Enterprise Edition (EE) version. You can't use Java 25 (preview) on EE10.
EE 11256.1 (default, recommended). Java 25 (preview) is configured to run EE 11 by default.To use Java EE 11, update your application servlets and dependencies to include theJakarta namespace. For more information, seeUpgrade Java on a compatible Enterprise Edition (EE) version.

Upgrade Java on a compatible Enterprise Edition (EE) version

To use Java 25 (preview) onEnterprise Edition 11 (EE 11), or Java 21 onEnterprise Edition 10 (EE 10), upgrade your application servlets and dependencies in yourMaven and Gradle files to include theJakarta namespace:

Java 25 (preview, EE 11)

To use Java 25 (preview) onEnterprise Edition 11 (EE 11), follow these steps:

  1. Change the version number in yourweb.xml configuration file toversion=6.1. For example:

    <web-appxmlns="https://jakarta.ee/xml/ns/jakartaee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaeehttps://jakarta.ee/xml/ns/jakartaee/web-app_6_1.xsd"version="6.1">...</web-app>
  2. Rename your application servlets and dependencies fromjavax.servlet.* tojakarta.servlet.*:

    importjakarta.servlet.ServletException;importjakarta.servlet.annotation.WebServlet;importjakarta.servlet.http.Cookie;importjakarta.servlet.http.HttpServlet;importjakarta.servlet.http.HttpServletRequest;importjakarta.servlet.http.HttpServletResponse;@WebServlet(name="viewer",urlPatterns={"/view"})publicclassMyServletextendsHttpServlet{......
  3. Update your remaining application third-party dependencies to newer Java artifacts,depending on theJakarta namespace.

  4. Add the following system property in yourappengine-web.xml file:

    <?xmlversion="1.0"encoding="utf-8"?><appengine-web-appxmlns="http://appengine.google.com/ns/1.0"><runtime>java25</runtime><system-properties><propertyname="appengine.use.EE11"value="true"/></system-properties><app-engine-apis>true</app-engine-apis></appengine-web-app>
  5. Optional: Java 25 includes support for virtual threads. To enablevirtual threads, add theappengine.use.virtualthreads property within thesystem-properties tagin yourappengine-web.xmlfile.

Java 21 (EE 10)

To use Java 21 onEnterprise Edition 10 (EE 10), follow these steps:

  1. Change the version number in yourweb.xml configuration file toversion=6.0. For example:

    <web-appxmlns="https://jakarta.ee/xml/ns/jakartaee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaeehttps://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"version="6.0">...</web-app>
  2. Rename your application servlets and dependencies fromjavax.servlet.* tojakarta.servlet.*:

    importjakarta.servlet.ServletException;importjakarta.servlet.annotation.WebServlet;importjakarta.servlet.http.Cookie;importjakarta.servlet.http.HttpServlet;importjakarta.servlet.http.HttpServletRequest;importjakarta.servlet.http.HttpServletResponse;@WebServlet(name="viewer",urlPatterns={"/view"})publicclassMyServletextendsHttpServlet{......
  3. Update your remaining application third-party dependencies to newer Java artifacts,depending on theJakarta namespace.

  4. Add the following system property in yourappengine-web.xml file:

    <?xmlversion="1.0"encoding="utf-8"?><appengine-web-appxmlns="http://appengine.google.com/ns/1.0"><runtime>java21</runtime><!--orjava17--><system-properties><propertyname="appengine.use.EE10"value="true"/></system-properties><app-engine-apis>true</app-engine-apis></appengine-web-app>
  5. Optional: Java 21 includes support for virtual threads. To enablevirtual threads, you add theappengine.use.virtualthreads property within thesystem-properties tagin yourappengine-web.xmlfile.

Java 17 and later (EE 8)

Usejavax.servlet.* APIs on Java EE 8 without major applicationconfiguration changes. EE 8 offers backward compatibility for Java EE 6and later.

To run your applications on Java EE 8, declare a newsystem-properties tag in yourappengine-web.xmlfile with the non-defaultapp.engine.use.EE8 configuration:

<?xmlversion="1.0"encoding="utf-8"?><appengine-web-appxmlns="http://appengine.google.com/ns/1.0"><runtime>java17</runtime><system-properties><propertyname="appengine.use.EE8"value="true"/></system-properties><app-engine-apis>true</app-engine-apis></appengine-web-app>

Optional: Java version 21 and later includes support for virtual threads. To enablevirtual threads, add theappengine.use.virtualthreads propertywithin thesystem-properties tag. Example:<property name="appengine.use.virtualthreads" value="true"/>

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.