Thanks Chesnay, I wanted to check out the tagged release 1.15.1. I did it in this way: git clone --depth 1 --branch release-1.15.1 g...@github.com:apache/flink.git
This seems cause the problem. With the same java/maven, I can build the branch 1.15. > On Sep 9, 2022, at 11:58 PM, Chesnay Schepler <ches...@apache.org> wrote: > > hmm...we've only seen that error in older Flink version: > https://nightlies.apache.org/flink/flink-docs-release-1.15/docs/flinkdev/ide_setup/#compilation-fails-with-cannot-find-symbol-symbol-method-defineclass-location-class-sunmiscunsafe > > <https://nightlies.apache.org/flink/flink-docs-release-1.15/docs/flinkdev/ide_setup/#compilation-fails-with-cannot-find-symbol-symbol-method-defineclass-location-class-sunmiscunsafe> > > Please double-check whether you actually checked out 1.15.1; I can't > reference to sun.misc.Unsafe in the 1.15.1 version of the mentioned class: > https://github.com/apache/flink/blob/release-1.15.1/flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/core/testutils/CommonTestUtils.java > > <https://github.com/apache/flink/blob/release-1.15.1/flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/core/testutils/CommonTestUtils.java> > > On 09/09/2022 22:01, Jun Qin wrote: >> I have an issue when build a clean Flink 1.15.1 on MacOS with: >> mvn clean install -DskipTests -Dfast >> >> % echo $JAVA_HOME >> >> >> /usr/local/Cellar/openjdk@11/11.0.16.1 >> >> % mvn -version >> >> >> Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63) >> Maven home: /usr/local/Cellar/maven/3.8.6/libexec >> Java version: 11.0.16.1, vendor: Homebrew, runtime: >> /usr/local/Cellar/openjdk@11/11.0.16.1/libexec/openjdk.jdk/Contents/Home >> Default locale: en_US, platform encoding: UTF-8 >> OS name: "mac os x", version: "12.5.1", arch: "x86_64", family: “mac" >> >> % java -version >> >> >> openjdk version "11.0.16.1" 2022-08-12 >> OpenJDK Runtime Environment Homebrew (build 11.0.16.1+0) >> OpenJDK 64-Bit Server VM Homebrew (build 11.0.16.1+0, mixed mode) >> >> It failed with: >> [ERROR] Failed to execute goal >> org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) >> on project flink-test-utils-junit: Compilation failure >> [ERROR] >> /Workspace/flink-1.15.1/flink-test-utils-parent/flink-test-utils-junit/src/main/java/org/apache/flink/core/testutils/CommonTestUtils.java:[244,53] >> cannot find symbol >> [ERROR] symbol: method >> defineClass(java.lang.String,byte[],int,int,java.lang.ClassLoader,java.security.ProtectionDomain) >> [ERROR] location: class sun.misc.Unsafe >> >> I tried also with a downloaded maven 3.2.5 binary (maven 3.2 has been >> disabled in brew): >> % ~/Downloads/apache-maven-3.2.5/bin/mvn -version >> >> >> Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; >> 2014-12-14T18:29:23+01:00) >> Maven home: /Users/jqin/Downloads/apache-maven-3.2.5 >> Java version: 11.0.16.1, vendor: Homebrew >> Java home: >> /usr/local/Cellar/openjdk@11/11.0.16.1/libexec/openjdk.jdk/Contents/Home >> Default locale: en_US, platform encoding: UTF-8 >> OS name: "mac os x", version: "12.5.1", arch: "x86_64", family: "mac" >> >> it failed at the same place with the same error message. >> >> Anything I did is wrong? >> >> Jun >