Posted On: Aug 12, 2020
You can now develop AWS Lambda functions using Java 8 (Corretto). Amazon Corretto 8 is a no-cost, production-ready distribution of OpenJDK 8 that comes with long-term support. Lambda functions written in Java 8 (Corretto) run on Amazon Linux 2, the latest generation of Amazon Linux. You can read more about the Java programming model in the AWS Lambda documentation.
Corretto 8 is designed as a drop-in replacement for OpenJDK 8. Amazon provides patches for Corretto 8 which are not yet integrated in the corresponding OpenJDK update projects. These patches include security fixes, performance enhancements (for example, speeding up frequently-used functions), garbage collection scheduling, and preventing out-of-memory situations, as well as improved monitoring, reporting, and thread management.
To get started, upload your code through the AWS Lambda console and select the Java 8 (Corretto) runtime. You can also use AWS CLI, AWS Serverless Application Model (SAM) and AWS CloudFormation for deploying and managing your serverless applications authored in Java 8 (Corretto). To migrate existing AWS Lambda functions running in OpenJDK 8 to Java 8 (Corretto), update your code to be compatible with Amazon Linux 2, and then update the function runtime to Java 8 (Corretto).