apache flink 无法解析导入 [英] apache flink not able to resolve imports

查看:145
本文介绍了apache flink 无法解析导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究 flink 介绍,但我无法正确导入

import org.apache.flink.streaming.api.datastream.DataStream;导入 org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;导入 org.apache.flink.walkthrough.common.sink.AlertSink;导入 org.apache.flink.walkthrough.common.entity.Alert;导入 org.apache.flink.walkthrough.common.entity.Transaction;导入 org.apache.flink.walkthrough.common.source.TransactionSource;

以上这些包无法导入我使用了以下网站

我能够从命令行(通过mvn clean package")构建应用程序,而无需进行任何更改.

Hi iam working on the flink introduction but iam not able to import properly

import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.walkthrough.common.sink.AlertSink;
import org.apache.flink.walkthrough.common.entity.Alert;
import org.apache.flink.walkthrough.common.entity.Transaction;
import org.apache.flink.walkthrough.common.source.TransactionSource;

these above packages are not able to import i have used from the following site link

in this link i have imported the project via mvn command

please help me resolve this

解决方案

I just tried this myself, and found that in order to run the application in my IDE (IntelliJ) I had to select the option under Run / Edit Configurations to 'Include dependencies with "Provided" scope'. Once I did that, everything worked fine.

I was able to build the application from the command line (via "mvn clean package") without making any changes.

这篇关于apache flink 无法解析导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆