Flink: Error: A JNI error has occurred, please check your installation and try again

created at 06-26-2022 views: 25

error

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" 
Process finished with exit code 1

solution

Adjust the corresponding dependency package scope to compile

Locate dependencies

java.land.NoClassDefFoundError Creat breakpoint:org/apache/flink/streaming/api/functions/source/SourceFunction

before modification

<dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-streaming-java_2.11</artifactId>
    <version>1.11.6</version>
    <scope>provided</scope>
</dependency>

after modification

<dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-streaming-java_2.11</artifactId>
    <version>1.11.6</version>
    <!-- <scope>provided</scope> --> # comment this line
    <scope>compile</scope> # add this
</dependency>

After modifying the dependency configuration, remember to update the dependency.

configuration

created at:06-26-2022
edited at: 06-26-2022: