Lambda function in Gradle Project failed to Running locally
See original GitHub issueDescribe the bug Running Lambda function in Gradle Project fails with “SAM build command failed”
To reproduce
- Create a Gradle SAM application
- Find
build.gradleand right clickImport Gradle Project - Open
App.javaand click Lambda icon on the left of the class definition. - Select
Run '[Local] App' - Select my Credentials and Region, and Input Text(API Gateway AWS Proxy)
- Execute
Run, but it fails with “SAM build command failed”
Build Output details is below.
/usr/local/bin/sam build --template /private/var/folders/94/599b3s8j0tbgnn506tmtd17m0000gq/T/template381.yaml --build-dir /private/var/folders/94/599b3s8j0tbgnn506tmtd17m0000gq/T/lambdaBuild1175
Build Failed
2019-03-28 21:41:51 Building resource 'Function'
Error: Unable to find a supported build workflow for runtime 'java8'. Reason: None of the supported manifests '['build.gradle', 'pom.xml']' were found in the following paths '['/Users/nomura.keichi/project/serverless/test/HelloWorldFunction/src/main', '/private/var/folders/94/599b3s8j0tbgnn506tmtd17m0000gq/T']'
Expected behavior The expected behavior is same as “Running a function locally” on AWS Toolkit for IntelliJ – Now generally available | AWS Developer Blog
Screenshots

Your Environment
- OS: macOS Mojave 10.14.4
- JetBrains’ Product: IntelliJ IDEA
- JetBrains’ Product Version: IntelliJ IDEA 2018.3.4 (Ultimate Edition) Build #IU-183.5429.30, built on January 29, 2019 JRE: 1.8.0_152-release-1343-b26 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
- Toolkit Version: 1.2
- SAM CLI Version: 0.14.2
- JVM/Python Version: Java 1.8.0_144
Additional context
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
AWS SAM: java8/gradle app fails with ClassNotFound when ...
Run sam build : sam build --use-container; Observe that the function runs successfully locally (this fails with the same ClassNotFound exception ...
Read more >Resolve "ClassNotFoundExeption" errors from Java Lambda ...
The ClassNotFoundException error occurs when a Java runtime loads a class by its fully qualified name, but doesn't locate the class.
Read more >Unit test fail when I run "gradle test" but run in Intellij successfully
When I open this project in Intellij, and switch to each single unit test file. All the test can be passed. But when...
Read more >Serverless Functions with Spring Cloud Function - Baeldung
We'll build and run a simple Spring Cloud Function locally and then deploy ... Since AWS Lambda is one of the popular serverless...
Read more >Create a Java function in Azure from the command line
Run az login to sign in to Azure and verify an active subscription. Create a local function project. In Azure Functions, a function...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This fix has been released in stable version 1.3. Feel free to reopen if you still see any issues.
That is good to hear, you can also go through the template’s gutter icon to auto fill in some of that information: