All Products
Search
Document Center

Serverless App Engine:Deploy a Java application

Last Updated:Sep 28, 2026

You can package your Java application into a JAR or WAR package and then deploy it to SAE.

Procedure

  1. On the SAE Application List page, select the target region and namespace in the top navigation bar, and then click Create Application.

  2. Select an application edition.

    Important

    The Lightweight Edition and Professional Edition are currently in an invite-only beta phase. For users not participating in the beta test, applications are created as the Standard Edition by default.

    • Lightweight Edition: Provides the minimum feature set required to run an application. It does not support the Application Monitoring and Microservices Governance features.

    • Standard Edition: Includes the Basic Application Monitoring feature. The Advanced Application Monitoring and Microservices Governance features must be enabled and purchased separately.

    • Professional Edition: Includes the Advanced Application Monitoring and Microservices Governance features, which do not need to be enabled or purchased separately.

  3. On the Create Application page, enter an Application Name and configure the following parameters.

    1. Select the namespace type for the application. A namespace is equivalent to a Kubernetes namespace and can be used to isolate resources in different environments. You cannot change the namespace of an application after it is created. Plan accordingly.

      • System Created: Use the default namespace, vSwitch, and security group created by the system in the current region.

      • Existing Namespace: Select a namespace, vSwitch, and security group that you created in advance.

    2. For Application Deployment Method, select Code Package-based Deployment, and then click Configure Code Package-based Deployment on the right. For Technology Stack Programming Language, select Java. For Code Package Type, select Deployment with JAR Packages or Deployment with WAR Packages. Select a Java environment compatible with your code. Set the following parameters, and then click OK.

      Parameter description - Configure a JAR or WAR package

      JAR package

      Parameter

      Description

      Application Runtime Environment

      • Standard Java Application Runtime Environment: For Spring Boot or Dubbo JAR packages.

      • EDAS-Container-XXX: For HSF JAR packages.

      Upload Method

      You can upload a local code package or enter the URL of the code package.

      Version

      Enter an application version number or select Use Timestamp as Version Number.

      Time Zone Settings

      Select the time zone for the application.

      Custom runtime environment settings

      (Optional) Enable this feature to pre-install tools, download or modify files, and install runtime dependencies or extensions for your application.

      Customize the runtime environment using the command line: The following are examples.

      CentOS

      #!/bin/bash
      
      # Install vim
      yum install -y vim

      Debian

      #!/bin/bash
      
      # Install vim
      apt install vim

      Alpine

      #!/bin/bash
      
      # Install vim
      apk add vim

      WAR package

      Parameter

      Description

      Application Runtime Environment

      • apache-tomcat-XXX: For Spring Boot or Dubbo WAR packages.

      • EDAS-Container-XXX: For HSF WAR packages.

      Upload Method

      You can upload a local code package or enter the URL of the code package.

      Version

      Enter an application version number or select Use Timestamp as Version Number.

      Time Zone Settings

      Select the time zone for the application.

      Custom runtime environment settings

      (Optional) Enable this feature to pre-install tools, download or modify files, and install runtime dependencies or extensions for your application.

      Customize the runtime environment using the command line: The following are examples.

      CentOS

      #!/bin/bash
      
      # Install vim
      yum install -y vim

      Debian

      #!/bin/bash
      
      # Install vim
      apt install vim

      Alpine

      #!/bin/bash
      
      # Install vim
      apk add vim
      Java Tomcat settings

      (Optional) Enable Custom Configuration, configure the Java Tomcat parameters, including Application Port, Tomcat Context, Maximum Threads, and Tomcat Encoding. The custom configuration overwrites the Tomcat configuration file /home/admin/xxx-tomcat-xxx/conf/server.xml in the application runtime environment.

      If the custom configuration options are insufficient, use configuration injection to overwrite the Tomcat configuration file with a custom server.xml file.

    3. In the Capacity Settings section, set Resource Type, Single Instance Type, and Instances.

  4. (Optional) Click Next: Advanced Settings to configure the required features.

    • Startup command

      JAR package

      The startup command is in the format Java[-options] -jar jarfile[args]. You can set options and args based on your requirements. For more information, see Set a startup command.

      WAR package

      The startup command is in the format java [-options] org.apache.catalina.startup.Bootstrap "$@" start. You can set options based on your requirements. For more information, see Set a startup command.

    • Runtime environment and lifecycle management

    • Network access and service invocation

    • Data persistence

      Store application data in NAS, OSS, or a database to prevent data loss when an application is changed or stopped. Note: NAS, OSS, and databases incur additional charges.

    • Logging and monitoring

      • After you deploy an application, you can view real-time logs and view resource usage and load without additional configuration. You can also output logs to SLS or Kafka for centralized management and analysis. Note: SLS and Kafka incur additional charges.

      • ARMS helps you track application health, quickly find failed and slow APIs, identify performance bottlenecks, and reproduce call parameters, which improves production troubleshooting efficiency.

        • For Standard Edition applications, you can view ARMS Basic Edition monitoring data after deployment without additional configuration. You can also enable and purchase ARMS Premium Edition monitoring.

        • For Professional Edition applications, after you enable Application Monitoring in Advanced Settings and deploy the application, you can view ARMS Premium Edition monitoring data. No additional fees are required.

    • Other features

      • Microservices Governance provides Graceful Start and Shutdown, traffic protection, end-to-end canary release, and Intra-zone Provider First for Java applications.

        • For Standard Edition applications, go to the application details page after deployment to enable and purchase the MSE Microservices Governance feature.

        • For Professional Edition applications, after you enable Microservices Governance in Advanced Settings, you can configure Graceful Start and Shutdown. For more features, go to the application details page after deployment. No additional fees are required.

      • You can enable the CPU Burst feature to avoid wasting resources when CPU requirements are higher at startup than during normal operation.

      • You can decouple and standardize non-business features from the main container by adding a sidecar container.

  5. Click Create Application with One Click or Create Application.

    • Creating the application takes about 1 to 2 minutes. You can view change records to verify that the deployment was successful. If the deployment fails, no application instance is created. You can troubleshoot the issue based on the error message in Change Details.

    • You can view the created application on the page. To change the application configuration after deployment, click the target application to go to its details page. Then, click Deploy Application or Modify Application Configurations at the top. The application automatically restarts to apply the new configuration. Perform this operation during off-peak hours.

    • You can log on to an application instance by using Webshell and interact with the instance by using console commands.

    • After you create an application, you can manually adjust the number of instances and the instance specification, or automatically adjust the number of instances by configuring an auto scaling policy. You can also reduce costs by enabling idle mode.