gpt4 book ai didi

spring - 使用gradle构建spring时出现编译错误

转载 作者:行者123 更新时间:2023-12-03 03:16:41 31 4
gpt4 key购买 nike

我通过使用git下载spring源来学习使用Spring和gradle。我已经使用下载了它
git clone git://github.com/SpringSource/spring-framework.git
另外,我在本地安装了gradle。

当我试图执行时

Gradle构建

我收到如下编译错误:

C:\Users\mahendran\spring-framework>gradle build
:spring-core:asmRepackJar
:spring-core:cglibRepackJar
:spring-core:compileJava
C:\Users\mahendran\spring-framework\spring-core\src\main\java\org\springframework\util\xml\StaxUtils.java:318:
cannot find symbol symbol : method newFactory()
location: class javax.xml.stream.XMLEventFactory
return new XMLEventStreamWriter(eventWriter, XMLEventFactory.newFactory());
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
: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.

BUILD FAILED

Total time: 1 mins 5.58 secs

最佳答案

这看起来像版本倾斜-我认为您需要更新JDK。 AFAICT,newFactory()已在JDK6版本1.6.0.18中添加。

关于spring - 使用gradle构建spring时出现编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13022820/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com