explain
Gradle project + Scala 2.11 + java8 + Flink 1.12
Error code:
kafkaSource.assignTimestampsAndWatermarks(WatermarkStrategy
.forBoundedOutOfOrderness[JSONObject](Duration.ofSeconds(10)))
Error message: static methods in interface require – target: jvm-1.8
From the perspective of error reporting, it is an error reported by Scala trying to call a static method in the java interface. However, JDK1.8 is used for compiling and packaging in the idea configuration
Modifying the following idea configuration is not valid:
So think about another breakthrough and add the following configuration to the build.gradle file to solve the problem.
project.tasks.compileScala.scalaCompileOptions.additionalParameters = ["-target:jvm-1.8"]
project.tasks.compileTestScala.scalaCompileOptions.additionalParameters = ["-target:jvm-1.8"]
Read More:
- Idea running Flink program reported an error: static methods in interface require- target:jvm-1.8
- Failed to import static file of vue3 static resource. There is no static folder
- Nuxt cannot find the static resource in static
- Default interface methods are only supported starting with Android N (–min-api 24): com.XXXX
- non-static variable this cannot be referenced from a static context
- Mistakes in learning Flink programming
- An error is reported when the file in hive parquet format is written in the Flink connection
- [Solved] Scala signature package has wrong version expected: 5.0 found: 5.2 in package.class
- Error in require.context in vue3 vite
- How to solve the problem of error reporting in Flink
- NoClassDefFoundError: org/apache/flink/metrics/MetricGroup
- Failed to find target with hash string”android-21″ in:D:\AndroidVersionSdk
- Solve the spark exception of scala version compiled by idea
- Why can’t Scala shell enter Q to exit
- Flink 1.1 error: no executorfactory found to execute the application
- Failed to find target with hash string ‘android-25’ in:D:\SDK
- ERROR in static/js/app.xxxxxxx.js from UglifyJs Unexpected token: operator (>)
- Python learning notes (5) — cross entropy error runtimeerror: 1D target tensor expected, multi target not supported
- Access characteristics of construction methods in Java inheritance
- org.apache.flink.runtime.client.JobSubmissionException: Failed to submit JobGraph