Spring框架构建失败

huangapple go评论70阅读模式
英文:

Springframework build failed

问题

我从官方GitHub克隆了spring-framework。
我想要构建它以将源代码导入IDEA
我进入spring-framework文件夹并执行以下操作
> gradlew :spring-oxm:compileTestJava

包装器下载gradle 6.6.1并在构建spring-core时失败。

spring-framework\spring-core\src\main\java\org\springframework\core\metrics\jfr\FlightRecorderStartupEvent.java:46:
错误:找不到符号
@Label("Tags")
^
符号:类Label
位置:类FlightRecorderStartupEvent

我使用的是Windows 10和Java 8。

有什么问题吗?也许我需要一些类路径?

英文:

I cloned spring-framework from official github.
I wanna build it to import sources to IDEA.
I go to folder spring-framework and execute
> gradlew :spring-oxm:compileTestJava

Wrapper downloads gradle 6.6.1 and fails to build spring-core.

spring-framework\spring-core\src\main\java\org\springframework\core\metrics\jfr\FlightRecorderStartupEvent.java:46:
error: cannot find symbol
    @Label("Tags")
     ^
symbol:   class Label
location: class FlightRecorderStartupEvent

I have Windows 10 and java 8.

What`s wrong? Maybe, I need some classpath?

答案1

得分: 1

阅读维基页面从源代码构建。其说明如下:

> 开始之前
>
>要进行构建,您将需要Git和JDK 8更新262或更高版本。由于依赖于Java Flight Recorder(JFR)类型,需要更新262或更高版本。然而,请注意,Oracle JDK不包括JFR类型。因此,我们推荐使用AdoptOpenJDK发行版或类似发行版,其中包括JFR类型。确保您的JAVA_HOME环境变量指向从JDK下载中提取的jdk1.8.0文件夹。

由于构建失败找不到JFR类,我推测您未使用JDK 8更新262或更高版本。您在构建Spring时不应需要做其他任何操作。

英文:

Read the wiki-page Build from source. It states:

> Before You Start
>
>To build you will need Git and JDK 8 update 262 or later. Update 262 or later is required due to the dependency on Java Flight Recorder (JFR) types. Note, however, that Oracle JDKs do not include the JFR types. Thus, we recommend an AdoptOpenJDK distribution or similar that includes the JFR types. Be sure that your JAVA_HOME environment variable points to the jdk1.8.0 folder extracted from the JDK download.

As your build fails finding a JFR class, I assume you are not using a JDK 8 update 262 or later. You should not need to do anything else for building Spring.

huangapple
  • 本文由 发表于 2020年9月23日 19:24:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/64026888.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定