flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alberto Ramón <a.ramonporto...@gmail.com>
Subject Re: Compile for Java 1.8
Date Sun, 13 Nov 2016 20:52:11 GMT
Thanks.
Sounds weird I imagine the Flink team have a road-map to migrate to Java 1.8


On "Build From source
<https://ci.apache.org/projects/flink/flink-docs-release-1.2/setup/building.html>":

"Flink requires *at least Java 7* to build. We recommend using Java 8."


2016-11-13 17:48 GMT+01:00 Andrey Melentyev <andrey.melentyev@gmail.com>:

> Hi Alberto,
>
> it seems that this class is not compatible with Java 8 new type inference
> rules, more specifically the 1.8 compiler picks a different overloaded
> method than 1.7.
>
> In TupleSerializer.java:112 the call to TypeSerializer.copy method in Java
> 7 resolves to
>
> public abstract T copy(T from, T reuse);
>
> while with Java 8 following the new inference rules (which basically
> selects the most specific matching method)  the compiler prefers
>
> public abstract void copy(DataInputView source, DataOutputView target) throws IOException;
>
> and the compilation fails. It's the only place in the production code
> where this change in the compilation logic seems to cause compile-time
> errors. There are a few unit tests that fail to pick the correct overloaded
> method alternative as well.
>
> Since Java 7 is end of life, I think it makes sense to be able to build
> Flink with Java 8 source/target. If you create a Jira for the compilation
> issue, I can suggest a PR fixing the compile-time errors and the tests.
>
> Note that you can still use JDK8 to compile Flink without changing the
> java.version in pom.xml, in this scenario the compiler will not try to use
> 1.8 language features and the compilation will succeed. You can also run
> your Flink cluster using the Java 8 runtime.
>
> Andrey
>
> On Sun, Nov 13, 2016 at 12:29 AM, Alberto Ramón <a.ramonportoles@gmail.com
> > wrote:
>
>> bash> git Clone
>> POM> <java.version>1.8</java.version>
>> bash> java -version ==> java version "1.8.0_111"
>>
>>
>> *Failed to execute goal
>> org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
>> (default-compile) on project flink-core: Compilation failure[ERROR] . . .
>> /flink1.2
>> _10_Nov/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/TupleSerializer.java:[112,63]
>> incompatible types: void cannot be converted to java.lang.Object*
>>
>> is this Normal ?
>> (If I put 1.7, there isn't any problem)
>>
>
>

Mime
View raw message