Thanks, Appreciate the quick turnaround.

I had to set up the $JAVA_HOME$ to 1.8 version so that maven can pick up that 
version and it started building for me. Thanks

________________________________
From: Chesnay Schepler <ches...@apache.org>
Sent: 03 August 2021 12:05:49
To: dev@flink.apache.org; Muhammad Haseeb Asif
Subject: Re: Compilation error - Execution of spotless-check goal failed in 
flink-annotations project

You are not using java 8, as shown by your maven output.
We have not made sure yet that Flink can be built on Java 16.

On 03/08/2021 12:00, Muhammad Haseeb Asif wrote:
> I am trying to build the Apache Flink project on my local machine and it 
> seems like failing due to spotless issues.
>
>
> I am running the build on mac with java 8
>
>
>   xyz% java -version
> java version "1.8.0_301"
> Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
> Java HotSpot(TM) 64-Bit Server VM (build 25.301-b09, mixed mode)
>
> Following is the error
>
>
> [ERROR] Failed to execute goal 
> com.diffplug.spotless:spotless-maven-plugin:2.4.2:check (spotless-check) on 
> project flink-annotations: Execution spotless-check of goal 
> com.diffplug.spotless:spotless-maven-plugin:2.4.2:check failed: 
> java.lang.reflect.InvocationTargetException: class 
> com.google.googlejavaformat.java.RemoveUnusedImports (in unnamed module 
> @0x4bc9389) cannot access class com.sun.tools.javac.util.Context (in module 
> jdk.compiler) because module jdk.compiler does not export 
> com.sun.tools.javac.util to unnamed module @0x4bc9389 -> [Help 1]
>
>
> We are getting the issue due to unused imports, so either we can remove the 
> spotless at all or somehow configure it to ignore the warning for specific 
> projects. Any ideas to build the project locally will be helpful.
>
>
> And maven version is as follows
>
>   xyz% mvn -version
> Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
> Maven home: /usr/local/Cellar/maven/3.8.1/libexec
> Java version: 16.0.1, vendor: Homebrew, runtime: 
> /usr/local/Cellar/openjdk/16.0.1/libexec/openjdk.jdk/Contents/Home
> Default locale: en_GB, platform encoding: UTF-8
> OS name: "mac os x", version: "11.5.1", arch: "x86_64", family: "mac"
>
>
> Some other details are
>
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Detecting the operating system and CPU architecture
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] os.detected.name: osx
> [INFO] os.detected.arch: x86_64
> [INFO] os.detected.bitness: 64
> [INFO] os.detected.version: 11.5
> [INFO] os.detected.version.major: 11
> [INFO] os.detected.version.minor: 5
> [INFO] os.detected.classifier: osx-x86_64
> [INFO] 
> ------------------------------------------------------------------------
>
> Any suggestions or thoughts will be helpful. Thanks
>
>

Reply via email to