I'm trying to build a Lambda application using AWS SAM CLI command:
sam build --template C:/MyProject/template.yaml --build-dir C:/MyProject/.aws-sam/build
but I'm getting this error:
Build Failed
Error: 'java8' runtime is not supported
This is my template.yaml:
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
  AWS Serverless Application
  Sample SAM Template for AWS Serverless Application
Globals:
  Function:
      Timeout: 20
Resources:
  HelloWorldFunction:
      Type: AWS::Serverless::Function
      Properties:
          CodeUri: target/HelloWorld-1.0.jar
          Handler: helloworld.App::handleRequest
          Runtime: java8
          Environment: 
              Variables:
                  PARAM1: VALUE
          Events:
              HelloWorld:
                  Type: Api
                  Properties:
                      Path: /hello
                      Method: get
It's an example project made in Intellij using AWS Toolkit plugin, I have installed SAM CLI version 0.9.0 and jdk1.8.0_191 (I've tried different versions but it didn't work), at the project's GitHub I can see that java 8 is supported:
[ ] Supported AWS Lambda Runtimes
    [x] java8
Why am I getting this error?
Seems like the build option doesn't support the java8 runtime
When I run sam build --help the result is: 
 which implies that it only works for python
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With