How to execute AWS lambda with Open JDK 11+ as custom runtime?

I doubt you can do that yet. According to AWS:

"We are working on Corretto 11 builds corresponding to Open JDK 11 and will release with time for testing before April, 2019."

https://forums.aws.amazon.com/thread.jspa?messageID=875742&tstart=0 https://aws.amazon.com/blogs/opensource/amazon-corretto-no-cost-distribution-openjdk-long-term-support/


As Arun Gupta said, they are working on Corretto 11 builds corresponding to Open JDK 11 and will release with time for testing before April, 2019...

However, it is still possible to add a custom runtime, which allow to "implement an AWS Lambda runtime in any programming language".

There is no example for JDK 11 in official AWS documentation, but I found a project, which use a custom runtime of 25MB, build from JDK 11, with jlink. You can take a look at this link


I was also curious as to why we haven't seen any custom runtimes for Java yet, so about a month ago I started playing around with the idea of building one in Java 11 using Jigsaw to produce small runtime. While it's not exactly a tutorial, I did write a fairly detailed Readme on how to build this and the code is simple enough to follow.

Here's my project on GitHub:

https://github.com/andthearchitect/aws-lambda-java-runtime

I just published this recently and it's most certainly a POC so use at your own risk.

Corretto seems interesting but I would guess there will still be people out there who are more comfortable with the official OpenJDK release. I'm hoping maybe this can be the starting point for a production ready open source runtime for Java.


There's no longer a need to use a custom runtime, as AWS Lambda now supports Java 11.

However, Lambda functions that use this runtime will be run with Amazon Corretto 11 and not OpenJDK 11.

If you wish to run your Lambda function with OpenJDK 11 instead of Corretto 11, then using a custom runtime is still recommended.