Hi, guys. I have found out that current flink project build with jdk11 wasn't implemented completed or pure jdk11 version. (higher version has same problem)
when enable jdk11, it has some scenarios. 1. Using jdk11 but source 1.8 target 1.8 -> it's ok. 2. Using jdk11 and with jdk11-target so the source 11 and target 11. -> build java also ok. But the generated bytecode version of scala class is already 52(jdk8). We can test with any of a scala classes under jdk11 build target. e.g. javap -verbose AggregateDataSet.class | grep major major version: 52 I have test many times and make conclusion that flink jdk11 now is not a completed or pure jdk11 version because of inconsistent bytecode version with java & scala. And it may cause some problems, for example: 1. inconsistent bytecode version between java & scala 2. Using reflection about class may generate some unknown errors 3. Runtime jdk11 environment can not optimize these lower bytecode. I have dipped into this problem including reading carefully from scala docs and asking from scala community[1][2] and found out we must upgrade scala to 2.13(2.11 & 2.12 only support generate bytecode version <=1.8). the 2.13 can support generating scala target 11 bytecode and higher and also jdk8. So I launch this discussion to see whether we can add scala-2.13 in flink jdk11 profile to support the completed or pure jdk11(or higher) version. And if we do not support and decide to maintain the current situation, I think we should let users or developers know this inconsistent problem, for example, update or make some comments in flink pom or docs. More details: https://issues.apache.org/jira/browse/FLINK-27549 [1] https://github.com/scala/bug/issues/12588 [2] https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html -- Best, Ran Tao