GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - GoogleCloudPlatform/appengine-java-standard: Google App Engine Standard Java runtime: Prod runtime, local devappserver, Cloud SDK Java components, GAE APIs, and GAE API emulators.

BranchesTags
Open more actions menu

Latest commit

 

History

1,429 Commits
1,429 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.mvn/wrapper
.mvn/wrapper
 
 
api
api
 
 
api_dev
api_dev
 
 
api_legacy
api_legacy
 
 
appengine-api-1.0-sdk
appengine-api-1.0-sdk
 
 
appengine-api-stubs
appengine-api-stubs
 
 
appengine_init
appengine_init
 
 
appengine_jsr107
appengine_jsr107
 
 
appengine_resources
appengine_resources
 
 
appengine_setup
appengine_setup
 
 
appengine_testing
appengine_testing
 
 
appengine_testing_tests
appengine_testing_tests
 
 
applications
applications
 
 
docs
docs
 
 
e2etests
e2etests
 
 
external/geronimo_javamail
external/geronimo_javamail
 
 
google3/third_party/java_src/appengine_standard
google3/third_party/java_src/appengine_standard
 
 
images
images
 
 
jetty121_assembly
jetty121_assembly
 
 
kokoro/gcp_ubuntu
kokoro/gcp_ubuntu
 
 
lib
lib
 
 
licenses/resources
licenses/resources
 
 
local_runtime_shared_jetty12
local_runtime_shared_jetty12
 
 
protobuf
protobuf
 
 
quickstartgenerator_jetty121_ee11
quickstartgenerator_jetty121_ee11
 
 
quickstartgenerator_jetty121_ee8
quickstartgenerator_jetty121_ee8
 
 
remoteapi
remoteapi
 
 
runtime
runtime
 
 
runtime_shared
runtime_shared
 
 
runtime_shared_jetty12
runtime_shared_jetty12
 
 
runtime_shared_jetty121_ee11
runtime_shared_jetty121_ee11
 
 
runtime_shared_jetty121_ee8
runtime_shared_jetty121_ee8
 
 
runtime_shared_jetty12_ee10
runtime_shared_jetty12_ee10
 
 
sdk_assembly
sdk_assembly
 
 
sessiondata
sessiondata
 
 
shared_sdk
shared_sdk
 
 
shared_sdk_jetty12
shared_sdk_jetty12
 
 
shared_sdk_jetty121
shared_sdk_jetty121
 
 
utils
utils
 
 
.gitignore
.gitignore
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
LICENSE_HEADER
LICENSE_HEADER
 
 
README.md
README.md
 
 
RELEASENOTES.md
RELEASENOTES.md
 
 
THIRD-PARTY.txt
THIRD-PARTY.txt
 
 
TRYLATESTBITSINPROD.md
TRYLATESTBITSINPROD.md
 
 
debugging.md
debugging.md
 
 
httpconnector.md
httpconnector.md
 
 
maven-version-rules.xml
maven-version-rules.xml
 
 
modules.md
modules.md
 
 
mvnw
mvnw
 
 
mvnw.cmd
mvnw.cmd
 
 
pom.xml
pom.xml
 
 
renovate.json
renovate.json
 
 
update_deps.sh
update_deps.sh
 
 

Repository files navigation

Java17/21/25 Maven Code of conduct

Google App Engine (GAE) standard environment source code for Java 17, Java 21, Java 25.

This repository contains the Java source code for Google App Engine standard environment, the production runtime, the App Engine APIs, and the local SDK.

Prerequisites

Use a JDK17 environment, so it can build the Java17 GAE runtime.

jdk17, but using a JDK21 or JDK25 is also possible.

The shared codebase is also used for GAE Java 17, Java 21 and Java 25 build and test targets, using GitHub actions:

  • Java 17/21/25 Continuous Integration

Releases

This repository is the open source mirror of the Google App Engine Java source code that was used to produce Maven artifacts and runtime jars. The open source release mechanism used with this GitHub repository is using the version starting at 3.0.x, compatible for Java 17 or above.

Modules

This repository is organized into several Maven modules. For a detailed description of each module, its dependencies, and how they relate to each other, see modules.md.

Orange items are public modules artifacts and yellow are internal ones. Modules ending with * are only used on the production server side.

pom_dependencies

App Engine Java APIs

Source code for all public APIs for com.google.appengine.api.* packages.

  • Public Documentation
  • Latest javadoc.io API Javadocs from this repository
  • Javadocs
  • Source Code
  • Source Code for repackaged API jar

Note that some App Engine APIs such as Blobstore and Taskqueues provide classes that depend on servlet APIs. The base packages com.google.appengine.api.blobstore and com.google.appengine.api.taskqueue contain classes that use javax.servlet.* for EE6/EE8 compatibility. For EE10 and EE11 environments that use the jakarta.servlet.* namespace, use classes from com.google.appengine.api.blobstore.jakarta and com.google.appengine.api.taskqueue.jakarta packages. The packages com.google.appengine.api.blobstore.ee10 and com.google.appengine.api.taskqueue.ee10 are deprecated starting from version 3.0.0.

  • Maven pom.xml

    <packaging>war</packaging><!-- Servlet 3.1 WAR packaging-->
    ...
    <dependencies>
        <dependency>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-api-1.0-sdk</artifactId>
            <version>5.2.0</version> <!-- GAE latest -->
        </dependency>
        <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>javax.servlet-api</artifactId>
          <version>3.1</version>
          <scope>provided</scope>
    </dependency>
    ...
    
  • Maven Java 21 with jakarta EE 10 support pom.xml

    <packaging>war</packaging><!-- Servlet 6.0 WAR packaging-->
    ...
    <dependencies>
        <dependency>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-api-1.0-sdk</artifactId>
            <version>5.2.0</version> <!-- GAE latest -->
        </dependency>
        <dependency>
          <groupId>jakarta.servlet</groupId>
          <artifactId>jakarta.servlet-api</artifactId>
          <version>6.0.0</version>
          <scope>provided</scope>
        </dependency>
    ...
    
  • Maven Java 25 with jakarta EE 11 support pom.xml (EE10 is not supported in Java25, EE11 is fully compatible with EE10)

    <packaging>war</packaging><!-- Servlet 6.1 WAR packaging-->
    ...
    <dependencies>
        <dependency>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-api-1.0-sdk</artifactId>
            <version>5.2.0</version> <!-- GAE latest -->
        </dependency>
        <dependency>
          <groupId>jakarta.servlet</groupId>
          <artifactId>jakarta.servlet-api</artifactId>
          <version>6.1.0</version>
          <scope>provided</scope>
        </dependency>
    ...
    
  • Java 21/25 with javax EE8 profile appengine-web.xml

    <?xml version="1.0" encoding="utf-8"?>
    <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
      <runtime>java25</runtime> <-- or java21-->
      <app-engine-apis>true</app-engine-apis>
    
      <!-- Add optionally:
      <system-properties>
        <property name="appengine.use.EE8" value="true"/>
    </system-properties>
    If you want to keep javax.servlet APIs and not jakarta.servlet by default
    -->
    </appengine-web-app>
    
  • Public Java 17/21/25 Documentation
  • How to upgrade to Java21/25
  • Java 17 appengine-web.xml

    <?xml version="1.0" encoding="utf-8"?>
    <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
      <runtime>java17</runtime>
      <app-engine-apis>true</app-engine-apis>
    </appengine-web-app>
    
  • Java 21 appengine-web.xml (will default to EE10, but EE8 possible)

    <?xml version="1.0" encoding="utf-8"?>
    <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
      <runtime>java21</runtime>
      <app-engine-apis>true</app-engine-apis>
    </appengine-web-app>
    
  • Java 25 appengine-web.xml (will default to EE11, but EE8 possible)

    <?xml version="1.0" encoding="utf-8"?>
    <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
      <runtime>java25</runtime>
      <app-engine-apis>true</app-engine-apis>
    </appengine-web-app>
    

App Engine Java Remote APIs

Source code for remote APIs for App Engine.

  • Public Documentation
  • Latest javadoc.io Javadocs from this repository
  • Public Sample remote server
  • Public Sample remote client
  • Source Code
  • Servlet web.xml
   <servlet>
     <display-name>Remote API Servlet</display-name>
     <servlet-name>RemoteApiServlet</servlet-name>
     <servlet-class>com.google.apphosting.utils.remoteapi.RemoteApiServlet</servlet-class>
     <load-on-startup>1</load-on-startup>
   </servlet>
   <servlet-mapping>
     <servlet-name>RemoteApiServlet</servlet-name>
     <url-pattern>/remote_api</url-pattern>
   </servlet-mapping>
  • Servlet jakarta EE10 and EE11 web.xml
   <servlet>
     <display-name>Remote API Servlet</display-name>
     <servlet-name>RemoteApiServlet</servlet-name>
     <servlet-class>com.google.apphosting.utils.remoteapi.JakartaRemoteApiServlet</servlet-class>
     <load-on-startup>1</load-on-startup>
   </servlet>
   <servlet-mapping>
     <servlet-name>RemoteApiServlet</servlet-name>
     <url-pattern>/remote_api</url-pattern>
   </servlet-mapping>
  • Maven javax and jakarta API pom.xml
    <dependency>
       <groupId>com.google.appengine</groupId>
       <artifactId>appengine-remote-api</artifactId>
       <version>5.2.0</version> <!-- GAE latest -->
    </dependency>

User Visible Changes With Maven Builds

We moved com.google.appengine.api.memcache.stdimpl and its old dependency javax.cache from appengine-api-1.0-sdk.jar to a new jar appengine-api-legacy.jar.

  • Latest javadoc.io Javadocs from this repository

    Users who depend on the moved classes will need to also include appengine-api-legacy.jar when they build/deploy. Separating these classes allows appengine-api-1.0-sdk users to choose any version of javax.cache rather than being constrained by an obsolete included version.

    • Maven pom.xml
    <dependency>
       <groupId>com.google.appengine</groupId>
       <artifactId>appengine-api-legacy.jar/artifactId>
       <version>5.2.0</version> <!-- GAE latest -->
    </dependency>

Local Unit Testing for Java 17, 21, 25

  • Code Sample

  • Latest javadoc.io Javadocs from this repository

    • Maven pom.xml
    <dependency>
      <groupId>com.google.appengine</groupId>
      <artifactId>appengine-testing</artifactId>
      <version>5.2.0</version> <!-- GAE latest -->
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.appengine</groupId>
      <artifactId>appengine-api-stubs</artifactId>
      <version>5.2.0</version> <!-- GAE latest -->
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.appengine</groupId>
      <artifactId>appengine-tools-sdk</artifactId>
      <version>5.2.0</version> <!-- GAE latest -->
      <scope>test</scope>
    </dependency>

App Engine Java local development implementation of the APIs

Implementation of all the App Engine APIs for local environment (devappserver) and local testing of an application before deployment.

  • Public Documentation
  • Source Code
  • Source Code for repackaged APIs stubs jar

App Engine Java various local development utilities and devappserver

Source code for the App Engine local dev application server and local utilities.

  • Public Documentation
  • Source Code for tools APIs (appcfg)
  • Source Code for XML validator (appcfg)
  • Source Code for local devappserver
  • Source Code for shared utilities (appcfg)
  • Source Code for shared utilities (config)

App Engine Java production runtime execution environment

Source code for the App Engine production application server and utilities. It is based on the Jetty9.4 Web Server.

  • Public Documentation
  • Source Code for the runtime implementation
  • Source Code for the Java Main
  • End-to-End test Web Applications
  • End-to-End tests
  • Source Code for runtime utilities

Default entrypoint used by Java17, Java21 and Java25

The Java 17, Java 21 and 25 runtimes can benefit from extra user configuration when starting the JVM for web apps.

The default entrypoint used to boot the JVM is generated by App Engine Buildpacks. Essentially, it is equivalent to define this entrypoint in the appengine-web.xml file. For example:

java --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.logging/java.util.logging=ALL-UNNAMED -showversion -Xms32M -Xmx204M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:+PrintCommandLineFlags -Dclasspath.runtimebase=/base/java_runtime -Djava.class.path=/base/java_runtime/runtime-main.jar -Djava.library.path=/base/java_runtime: com.google.apphosting.runtime.JavaRuntimeMainWithDefaults --fixed_application_path=/workspace /base/java_runtime

For Java25, the base layer is in the builder image under /layers/google.java.appengine/java_runtime, so:

java --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.logging/java.util.logging=ALL-UNNAMED -showversion -Xms32M -Xmx204M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:+PrintCommandLineFlags -Dclasspath.runtimebase=/layers/google.java.appengine/java_runtime -Djava.class.path=/layers/google.java.appengine/java_runtime/runtime-main.jar -Djava.library.path=/layers/google.java.appengine/java_runtime: com.google.apphosting.runtime.JavaRuntimeMainWithDefaults --fixed_application_path=/workspace /layers/google.java.appengine/java_runtime

We do not recommend changing this default entrypoint as the memory settings are calculated based on the instance type (F1, F2, F4) and memory available.

By default, we use --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio.charset=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED to open some necessary JDK APIs.

Entry Point Features

The entry point for the Java 17, Java 21, 25 runtimes can be customized with user-defined environment variables added in the appengine-web.xml configuration file.

The following table indicates the environment variables that can be used to enable/disable/configure features, and the default values if they are not set:

Env Var Description Type Default
CPROF_ENABLE Stackdriver Profiler boolean false
GAE_MEMORY_MB Available memory size Set by GAE or /proc/meminfo-400M
HEAP_SIZE_RATIO Memory for the heap percent 80
HEAP_SIZE_MB Available heap size ${HEAP_SIZE_RATIO}% of ${GAE_MEMORY_MB}
JAVA_HEAP_OPTS JVM heap args JVM args -Xms${HEAP_SIZE_MB}M -Xmx${HEAP_SIZE_MB}M
JAVA_GC_OPTS JVM GC args JVM args -XX:+UseG1GC plus configuration
JAVA_USER_OPTS JVM other args JVM args
JAVA_OPTS JVM args JVM args See below

If not explicitly set, JAVA_OPTS is defaulted to:

JAVA_OPTS:=-showversion \
           ${DBG_AGENT} \
           ${PROFILER_AGENT} \
           ${JAVA_HEAP_OPTS} \
           ${JAVA_GC_OPTS} \
           ${JAVA_USER_OPTS}

When CPROF_ENABLE is true, the default entrypoint adds the PROFILER_AGENT as:

-agentpath:/opt/cprof/profiler_java_agent.so=--logtostderr

For example, if your application code needs more -add-opens flags, you can use the JAVA_USER_OPTS environment variable defined in the appengine-web.xml file:

  <env-variables>
     <env-var name="JAVA_USER_OPTS" value="--add-opens java.base/java.util=ALL-UNNAMED" />
   </env-variables>

Note:

  • Only one of appengine.use.EE8, appengine.use.EE10, or appengine.use.EE11 can be set to true at a time.
  • Flags can be set in WEB-INF/appengine-web.xml or via Java system properties (e.g., -Dappengine.use.EE10=true). System properties override appengine-web.xml.
  • EE6 = Servlet 3.1 (javax.*), EE8 = Servlet 4.0 (javax.*), EE10 = Servlet 5.0 (jakarta.*), EE11 = Servlet 6.0 (jakarta.*).
  • Jetty 12.1 should be fully backward compatible with Jetty 12.0 and EE11 version should also be backward compatible with EE10.
  • EE8 should also be backward compatible with EE6.

Java 17 (<runtime>java17</runtime>)

Flag(s) Set in appengine-web.xml or System Properties Resulting Jetty Support Resulting EE Version Notes
None (default)* 9.4 GA 6
appengine.use.EE8=true 12.0 GA 8
appengine.use.EE10=true 12.0 GA 10
appengine.use.EE8=true, appengine.use.jetty121=true 12.1 Early Access 8
appengine.use.EE10=true, appengine.use.jetty121=true 12.1 Early Access 11 Upgraded: EE10 is upgraded to EE11 on Jetty 12.1
appengine.use.EE11=true 12.1 Early Access 11 appengine.use.jetty121=true is used automatically

Note: * We are gradually rolling out an update that switches Java 17 applications from Jetty 9.4 to Jetty 12.0 with EE8. If your application has been updated, you will see the following message in your logs:

AppEngine runtime configuration: runtimeId=java17, with Jetty 12, with HTTP Connector, appengine.use.EE8=true.

Java 21 (<runtime>java21</runtime>)

Flag(s) Set in appengine-web.xml or System Properties Resulting Jetty Support Resulting EE Version Notes
None (default) 12.0 GA 10
appengine.use.EE8=true 12.0 GA 8
appengine.use.EE10=true 12.0 GA 10
appengine.use.jetty121=true 12.1 Early Access 11 If no EE flag is set, jetty121 defaults to EE11
appengine.use.EE8=true, appengine.use.jetty121=true 12.1 Early Access 8
appengine.use.EE10=true, appengine.use.jetty121=true 12.1 Early Access 11 Upgraded: EE10 is upgraded to EE11 on Jetty 12.1
appengine.use.EE11=true 12.1 Early Access 11 appengine.use.jetty121=true is used automatically

Java 25 (<runtime>java25</runtime>)

Flag(s) Set in appengine-web.xml or System Properties Resulting Jetty Support Resulting EE Version Notes
None (default) 12.1 GA 11 appengine.use.jetty121=true is used
appengine.use.EE8=true 12.1 GA 8 appengine.use.jetty121=true is used
appengine.use.EE11=true 12.1 GA 11 appengine.use.jetty121=true is used
appengine.use.EE10=true ERROR Unsupported ERROR EE10 is not supported, use compatible version EE11 instead

Contributing

Check out the contributing guide to learn how you can report issues and help make changes.

Always be sure to follow the Code of Conduct.

About

Google App Engine Standard Java runtime: Prod runtime, local devappserver, Cloud SDK Java components, GAE APIs, and GAE API emulators.

Topics

appengineappengine-javagooglegoogle-cloudgoogle-cloud-platformjavajava-8java11java17java8paasserverlessservlets

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

223 stars

Watchers

35 watching

Forks

66 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.