enhancement request: Support Java 21 preview · Issue #9330 · localstack/localstack · GitHub
Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

enhancement request: Support Java 21 preview #9330

Description

@eddumelendez

Is there an existing issue for this?

  • I have searched the existing issues

Enhancement description

Currently, Java 21 preview is provided according to this comment. It would be nice to support it via LocalStack and start testing it.

🧑‍💻 Implementation

I think java21-preview should be added here

So, the code below should work.

var createFunctionRequest = CreateFunctionRequest.builder()
			.functionName(fnName)
			.runtime("java21-preview")
			.role("arn:aws:iam::123456789012:role/irrelevant")
			.packageType(PackageType.ZIP)
			.code(FunctionCode.builder()
				.zipFile(SdkBytes.fromByteArray(FileUtils.readFileToByteArray(new File(jar))))
				.build())
			.timeout(10)
			.handler("org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest")
			.environment(Environment.builder().variables(envVars).build())
			.build();

Anything else?

It can be tested with this java project

Metadata

Metadata

Assignees

Labels

aws:lambdaAWS Lambdatype: featureNew feature, or improvement to an existing feature

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions