已配置JDK 1.8执行Maven构建仍报错:需JDK或tools.jar
问题:Maven构建报错提示需使用JDK运行或添加tools.jar到类路径
执行Maven构建时出现以下错误:
org.apache.maven.plugin.MojoExecutionException: You need to run the build with JDK or have tools.jar on the classpath.If this occurs during eclipse build, make sure you run Eclipse under JDK as well
已做配置及操作
- 项目基于Java 1.8、Maven 3.3.9构建,开发环境为Eclipse
- 已关联包含tools.jar的JDK 1.8,配置了Java和Maven环境变量
- Eclipse中
Preference > Java > Installed JREs已设置为JDK 1.8 - 勾选了Eclipse的
Maven > Java Configurator对应选项 - 尝试过手动添加tools.jar到项目引用库
报错相关的pom.xml构建配置
<build> <plugins> <plugin> <groupId>com.mysema.maven</groupId> <artifactId>apt-maven-plugin</artifactId> <version>1.1.3</version> <executions> <execution> <goals> <goal>process</goal> </goals> <configuration> <outputDirectory>target/generated-sources/java</outputDirectory> <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor> </configuration> </execution> </executions> <dependencies> <dependency> <groupId>com.querydsl</groupId> <artifactId>querydsl-apt</artifactId> <version>${querydsl.version}</version> </dependency> </dependencies> </plugin> </plugins> </build>
请问还需要检查哪些配置项,或者提供哪些额外信息来定位问题?
内容的提问来源于stack exchange,提问作者Alejandro Manuel Carrion
相关产品推荐
相关产品推荐

