Scala版本不一致,你本机的是Scala 2.13.0,Flink源码对应的是Scala 2.11,你把本机的Scala版本和Flink 
1.7对应的Scala版本保持一致就可以了,建议是本地安装Scala 2.11重新编译Flink 1.7。
在 2019-08-12 15:15:38,"苟刚" <gougang_1...@163.com> 写道:
>
>
>
>Hi,All:
>
>
>  我再尝试编译flink 1.7的源码时,遇到如下错误,本人对scala不是很了解,不知道是不是版本问题引起,另外可以去掉sacla模块编译吗:
> 本机scala版本:2.13.0
>JDK 版本: 1.8.0_91
>[ERROR] Failed to execute goal 
>org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) 
>on project flink-scala_2.11: Compilation failure: Compilation failure:
>[ERROR] 
>/Users/gang.gou/work/git/github/flink/flink-scala/src/main/java/org/apache/flink/api/scala/typeutils/ScalaEitherSerializerSnapshot.java:[67,44]
> 不兼容的类型: 
>无法推断org.apache.flink.api.java.typeutils.runtime.EitherSerializer<>的类型参数
>[ERROR] 原因: 不存在类型变量L,R,T,T的实例, 
>以使org.apache.flink.api.java.typeutils.runtime.EitherSerializer<L,R>与org.apache.flink.api.common.typeutils.TypeSerializer<scala.util.Either<L,R>>一致
>[ERROR] 
>/Users/gang.gou/work/git/github/flink/flink-scala/src/main/java/org/apache/flink/api/scala/typeutils/ScalaEitherSerializerSnapshot.java:[78,86]
> 不兼容的类型: 
>org.apache.flink.api.common.typeutils.TypeSerializer<scala.util.Either<L,R>>无法转换为org.apache.flink.api.java.typeutils.runtime.EitherSerializer<L,R>
>[ERROR] -> [Help 1]
>[ERROR] 
>[ERROR] To see the full stack trace of the errors, re-run Maven with the -e 
>switch.
>[ERROR] Re-run Maven using the -X switch to enable full debug logging.
>[ERROR] 
>[ERROR] For more information about the errors and possible solutions, please 
>read the following articles:
>[ERROR] [Help 1] 
>http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
>[ERROR] 
>[ERROR] After correcting the problems, you can resume the build with the 
>command
>[ERROR]   mvn <goals> -rf :flink-scala_2.11
>
>
>Process finished with exit code 1
>
>
>
>
>--
>Best Wishes
>   Galen.K

回复