Flink Compile Error Static methods in interface require -target:jvm-1.8

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Flink Compile Error Static methods in interface require -target:jvm-1.8

Yunhui Han
Hi, all

I want to upgrade my flink to 1.12.0. I used the new API for watermark.

image.png

I got an error when I compiled my jar.

image.png

My pom file content is this.
image.png
image.png

My JDK version is this.
image.png

Can anyone help me with this? 

Sincerely

Reply | Threaded
Open this post in threaded view
|

Re: Flink Compile Error Static methods in interface require -target:jvm-1.8

Chesnay Schepler
You have to configure the scala-maven-plugin to compile to java 8.

Add this to the configuration of the plugin:
<arg>-target:jvm-${target.java.version}</arg>

On 2/3/2021 10:12 AM, Yunhui Han wrote:
Hi, all

I want to upgrade my flink to 1.12.0. I used the new API for watermark.

image.png

I got an error when I compiled my jar.

image.png

My pom file content is this.
image.png
image.png

My JDK version is this.
image.png

Can anyone help me with this? 

Sincerely


Reply | Threaded
Open this post in threaded view
|

Re: Flink Compile Error Static methods in interface require -target:jvm-1.8

Yunhui Han
Thanks,  Chesnay Schepler.

Could you please show me an example of scala-maven-plugin configuration?


On Wed, Feb 3, 2021 at 5:26 PM Chesnay Schepler <[hidden email]> wrote:
You have to configure the scala-maven-plugin to compile to java 8.

Add this to the configuration of the plugin:
<arg>-target:jvm-${target.java.version}</arg>

On 2/3/2021 10:12 AM, Yunhui Han wrote:
Hi, all

I want to upgrade my flink to 1.12.0. I used the new API for watermark.

image.png

I got an error when I compiled my jar.

image.png

My pom file content is this.
image.png
image.png

My JDK version is this.
image.png

Can anyone help me with this? 

Sincerely


Reply | Threaded
Open this post in threaded view
|

Re: Flink Compile Error Static methods in interface require -target:jvm-1.8

Yunhui Han
I solved the problem with the configuration below. Thank you Chesnay Schepler.
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<args>
<arg>-target:jvm-${target.java.version}</arg>
</args>
</configuration>
</plugin>

On Wed, Feb 3, 2021 at 6:10 PM Yunhui Han <[hidden email]> wrote:
Thanks,  Chesnay Schepler.

Could you please show me an example of scala-maven-plugin configuration?


On Wed, Feb 3, 2021 at 5:26 PM Chesnay Schepler <[hidden email]> wrote:
You have to configure the scala-maven-plugin to compile to java 8.

Add this to the configuration of the plugin:
<arg>-target:jvm-${target.java.version}</arg>

On 2/3/2021 10:12 AM, Yunhui Han wrote:
Hi, all

I want to upgrade my flink to 1.12.0. I used the new API for watermark.

image.png

I got an error when I compiled my jar.

image.png

My pom file content is this.
image.png
image.png

My JDK version is this.
image.png

Can anyone help me with this? 

Sincerely