【发布时间】:2019-02-25 02:58:48
【问题描述】:
我根据site的代码创建了一个项目
roo> project setup --topLevelPackage com.foo
roo> jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
roo> entity jpa --class ~.domain.Timer
roo> field string --fieldName message --notNull
roo> repository jpa --all
roo> service --all
roo> web mvc setup
roo> web mvc view setup --type THYMELEAF
roo> web mvc controller --all --responseType THYMELEAF
roo> web mvc controller --all --pathPrefix /api
roo> quit
mvn spring-boot:run
项目构建完成,出现如下错误
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.054 s
[INFO] Finished at: 2018-09-20T19:45:28+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.mysema.maven:apt-maven-plugin:1.1.3:process
default) on project hello: You need to run build with JDK or have tools.jar on
he classpath.If this occures during eclipse build make sure you run eclipse und
r JDK as well -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swi
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
POM.xml 可以找到here。 Spring roo-2.0.0.RELEASE 在 pom.xml 文件(第 592 行)中也会显示错误:
You need to run build with JDK or have tools.jar on the classpath.
If this occures during eclipse build make sure you run eclipse under
JDK as well (com.mysema.maven:apt-maven-plugin:1.1.3:process:default:generate-sources)
在 elcipse 配置中 - c:\Program Files\Java\jdk1.8.0_181。
当我从命令行mvn spring-boot:run 运行项目时,我得到了相同的结果
【问题讨论】:
-
错误很明显......您需要使用JDK运行构建或在类路径上有tools.jar。如果在eclipse构建期间发生这种情况,请确保您也在JDK下运行eclipse.. ..你需要安装一个JDK
标签: java maven spring-roo