【发布时间】:2021-07-23 11:49:15
【问题描述】:
我最近在运行命令 sam build 时开始遇到 maven 错误。
我决定创建 hello world 应用程序 (https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started-hello-world.html) 看看我是否也会遇到同样的错误,我明白了。
这是运行sam build后的输出:
Building codeuri: [service] runtime: java11 metadata: {} functions: ['service']
C:\apache-maven-3.6.3\bin\mvn.CMD failed to return a version string using the '-v' option. The workflow is unable to check that the version of the JVM used is compatible with AWS Lambda.
这是C:\apache-maven-3.6.3\bin\mvn.CMD -v的输出:
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\apache-maven-3.6.3\bin\..
Java version: 1.8.0_261, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_261\jre
Default locale: en_CA, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
The system cannot find the path specified.
【问题讨论】:
-
我认为你可能需要安装 jdk 11。似乎你有 jdk8。 (我可能错了)
-
我换成java 11还是同样的问题
标签: amazon-web-services maven aws-sam aws-sam-cli