Env: OS: win10(10.0.18362.1082 showed by cmd) jdk: jdk1.8.0_261(oracle jdk 64bit) gradle: 6.6.1 After I download the source code by git clone, then I use cmd, switch to the root dir of spring-framework-5.2.8, I execute "gradlew.bat", everything is right(BUILD SUCCESSFUL), and the next step(followed the file import-into-eclipse.md), I go to build spring-oxm by command "gradlew.bat :spring-oxm:check", and it shows BUILD FAILED(Task :spring-core:compileJava FAILED), the main error is that "程序包jdk.jfr不存在", it means "package jdk.jfr does not exist", the full error is followed: E:\git\spring-framework-5.2.8>gradlew.bat :spring-oxm:check

Task :spring-core:compileJava E:\git\spring-framework-5.2.8\spring-core\src\main\java\org\springframework\core\metrics\jfr\FlightRecorderStartupEvent.java:19: 错误: 程序包jdk.jfr不存在 import jdk.jfr.Category; ^ E:\git\spring-framework-5.2.8\spring-core\src\main\java\org\springframework\core\metrics\jfr\FlightRecorderStartupEvent.java:20: 错误: 程序包jdk.jfr不存在 import jdk.jfr.Description; ^ E:\git\spring-framework-5.2.8\spring-core\src\main\java\org\springframework\core\metrics\jfr\FlightRecorderStartupEvent.java:21: 错误: 程序包jdk.jfr不存在 import jdk.jfr.Event; ^ E:\git\spring-framework-5.2.8\spring-core\src\main\java\org\springframework\core\metrics\jfr\FlightRecorderStartupEvent.java:22: 错误: 程序包jdk.jfr不存在 import jdk.jfr.Label; ^ E:\git\spring-framework-5.2.8\spring-core\src\main\java\org\springframework\core\metrics\jfr\FlightRecorderStartupEvent.java:37: 错误: 找不到符号 class FlightRecorderStartupEvent extends Event { ^ 符号: 类 Event E:\git\spring-framework-5.2.8\spring-core\src\main\java\org\springframework\core\metrics\jfr\FlightRecorderStartupEvent.java:34: 错误: 找不到符号 @Category("Spring Application") ^ 符号: 类 Category E:\git\spring-framework-5.2.8\spring-core\src\main\java\org\springframework\core\metrics\jfr\FlightRecorderStartupEvent.java:35: 错误: 找不到符号 @Label("Startup Step") ^ 符号: 类 Label E:\git\spring-framework-5.2.8\spring-core\src\main\java\org\springframework\core\metrics\jfr\FlightRecorderStartupEvent.java:36: 错误: 找不到符号 @Description("Spring Application Startup") ^ 符号: 类 Description E:\git\spring-framework-5.2.8\spring-core\src\main\java\org\springframework\core\metrics\jfr\FlightRecorderStartupEvent.java:43: 错误: 找不到符号 @Label("Name") ^ 符号: 类 Label 位置: 类 FlightRecorderStartupEvent E:\git\spring-framework-5.2.8\spring-core\src\main\java\org\springframework\core\metrics\jfr\FlightRecorderStartupEvent.java:46: 错误: 找不到符号 @Label("Tags") ^ 符号: 类 Label 位置: 类 FlightRecorderStartupEvent

Task :spring-core:compileJava FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':spring-core:compileJava'.

    Compilation failed; see the compiler error output for details.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.6/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 10s 20 actionable tasks: 3 executed, 17 up-to-date


What should I do?

Comment From: bclozel

As explained in the building from source section, you need a more recent version of the JDK 8, one with the Flight Recorder classes back portes in it.

See https://github.com/spring-projects/spring-framework/wiki/Build-from-Source#before-you-start

Thanks!

Comment From: xiao911wei

I got it. Thanks.