not a JRE
问题
在使用pom.xml配置默认Goal的时,如果默认的Goal为clean就没问题,但如果是如:
- <build>
- <defaultGoal>clean compile</defaultGoal>
- </build>
就会报错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project Demo: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files\Java\jre7\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
- 经过几番尝试,才发现并不是多个Goal的问题,而是compile Goal的问题。但使用命令的"mvn compile"又是OK的。
几经折腾才发现错误里说的很清楚:Please ensure you are using JDK 1.4 or above and not a JRE",它需要的是JDK而不是JRE。我给的项目中使用的是公共JRE:
解决
修改Eclipse的配置,使用JDK:Eclipse->Window->Preferences->Java->Installed JREs
Finish后,项目如:
OK,知之为知之,不知创造条件必须知!!
出现问题2:
1、使用spring 注解,如果有两个类的对象一样的名称,程序报错
eg:就会报错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project Demo: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files\Java\jre7\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
相关推荐
Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project
在<plugins></plugins>中添加<plugin> <groupId>org.apache.maven.plugins <artifactId>maven-compiler-plugin <version>3.8.1 <source>1.8 <target>1.8 </plugin>
idea创建Maven项目时,报错显示Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.0.2:resources,并且Maven插件内看不到 mybatis-generator。如下图: 折腾了好久发现配置放错地方了,...
主要介绍了Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1的解决办法的相关资料,需要的朋友可以参考下
maven-surefire-plugin-2.22.1.jar
maven-notice-plugin-1.0.1.jar
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor (default -descriptor) on project maven-project: Error extracting plugin descriptor: ‘No mojo definitions wer...
Failed to execute goal org.apache.maven.plugins:maven-help-plugin:3.1.0:system (default-cli) on project standalone-pom: Execution default-cli of goal org.apache.maven.plugins:maven-help-plugin...
pit1 spring boot之 maven install 报错[Maven][ERROR] Failed to execute goal org.spri
jetty-6.1.14(1).zip 共三部分,23.7m
1.7 or above (this is to execute Maven - it still allows you to build against 1.3 and prior JDK's). Memory: No minimum requirement. Disk: Approximately 10MB is required for the Maven ...
spring-petclinic-master运行mvn install报错:Failed to execute goal io.spring.javaformat:spring-javaformat-maven-plugin:0.0.19:validate (default) on project spring-petclinic: Formatting violations ...
thingsboard编译错误 Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.0:npm (npm install) on project js-executor: Failed to run task: 'npm install' failed. 该错误如果是3.0上的,请将...
pom.xml嵌入插件: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.2</version> <executions> <execution> <phase>package</phase> <goals> <goal>...
NULL 博文链接:https://wandyqian.iteye.com/blog/2180480
1.7 or above (this is to execute Maven - it still allows you to build against 1.3 and prior JDK's). Memory: No minimum requirement. Disk: Approximately 10MB is required for the Maven ...
Failed to execute goal com.mycila.maven-license-plugin:maven-license-plugin:1.9.0:check (default) on project cas-server-webapp: Resource E:\IDEAWork\test\hxyFrame\frame-casServer/src/licensing/header....
解决生成pdf中文乱码以及缺失的问题,支持自定义字体。 修改pom.xml中的 swagger.input属性值中的ip和port 执行mvn clean test完成之后,会在/target/asciidoc/pdf/目录下生成index.pdf,该pdf文件即是生成的swagger...
java8 源码 搭建Spark源码本地研读环境 ...org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M2:enforce (enforce-maven-version) on project spring-data-jpa: Some Enforcer rules have failed. Loo
commons-codec-1.13.jar是主要解决这个包放到android项目里出现org.apache.commons.codec.binary.Hex.encodeHexString的异常,我已经将源码中的错误解决掉,直接下载使用即可。