我第一次尝试使用aws-cdk。
我在构建java应用程序时遇到以下错误
Cannot find the 'jsii-runtime' executable
maven依赖
<dependency>
<groupId>software.amazon.awscdk</groupId>
<artifactId>cdk-cloudformation-include</artifactId>
<version>1.79.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/software.amazon.jsii/jsii-runtime -->
<dependency>
<groupId>software.amazon.jsii</groupId>
<artifactId>jsii-runtime</artifactId>
<version>1.16.0</version>
</dependency>
<dependency>
<groupId>software.amazon.awscdk</groupId>
<artifactId>s3</artifactId>
<version>1.79.0</version>
</dependency>
java代码
import software.amazon.awscdk.core.Construct;
import software.amazon.awscdk.core.Stack;
import software.amazon.awscdk.core.StackProps;
import software.amazon.awscdk.cloudformation.include.CfnInclude;
public class MyStack extends Stack {
public MyStack(final Construct scope, final String id) {
this(scope, id, null);
}
public MyStack(final Construct scope, final String id, final StackProps props) {
super(scope, id, props);
CfnInclude template = CfnInclude.Builder.create(this, "Template")
.templateFile("/home/vmdovs/NetBeansProjects/cf-import/yaml2/ubuntu16.04LTS_cfn-hup.yaml")
.build();
}
}
public void testawscdk() {
App app = new App();
new MyStack(app, "MyStack");
}
让我知道你的想法
1条答案
按热度按时间thigvfpy1#
错误的原因是没有安装aws cdk
以下安装脚本解决了该问题