Java Runtime on Amazon Linux 2023¶
This reference describes how AWS Elastic Beanstalk runs Java applications on the Corretto platform branch on Amazon Linux 2023. It focuses on platform selection, JAR discovery, Procfile startup, proxy behavior, and JVM tuning.
Prerequisites¶
- A Java Elastic Beanstalk environment using Amazon Linux 2023.
- Access to application source including
pom.xml,Procfile, and optional.ebextensionsfiles. - Familiarity with deployment lifecycle and health checks.
What You'll Build¶
You will establish a runtime baseline that includes:
- Explicit Corretto platform selection.
- Predictable JAR startup from project root or
target/. - JVM options managed by
.ebextensions. - Health routing through nginx and Elastic Beanstalk process settings.
graph TD
A[Source Bundle] --> B[Elastic Beanstalk Java Platform]
B --> C[Locate JAR or Procfile Command]
C --> D[Launch java -jar]
D --> E[Spring Boot Listens on PORT]
F[nginx Reverse Proxy] --> E
G[.ebextensions JVM Options] --> D
H[HealthCheckPath /health] --> F Steps¶
- List Java platform versions in your Region.
aws elasticbeanstalk list-platform-versions --filters "Type=PlatformName,Operator==,Values=Corretto" --region "$REGION"
- Use the recommended platform branch for this guide.
- Keep the packaged JAR in a location the deployment bundle includes.
- Use
Procfilewhen you want explicit startup behavior.
- Bind Spring Boot to the platform-provided port.
- Set JVM options with
.ebextensionswhen you need memory tuning.
- Configure
/healthas the process health check path.
Platform notes¶
- Elastic Beanstalk Java on Linux uses Amazon Corretto, not Oracle JDK.
- The load balancer and nginx proxy handle inbound traffic before it reaches Spring Boot.
- If
Procfileexists, it becomes the clearest way to define the startup command. - Keep heap settings conservative until you confirm actual memory usage under load.
Verification¶
Use these checks to validate runtime assumptions:
eb status "$ENV_NAME"
eb logs --all
aws elasticbeanstalk describe-configuration-settings --application-name "$APP_NAME" --environment-name "$ENV_NAME" --region "$REGION"
Expected outcomes:
- The environment runs a Corretto 17 AL2023 platform.
- Elastic Beanstalk launches the JAR from
Procfileor platform defaults. - Spring Boot listens on the value provided in
PORT. - JVM options and health path appear in configuration settings.