eclipse中使用m2eclipse,出现COMPILATION ERROR的一种情况

错误信息如下:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.499 s


eclipse默认running在JRE上,而非JDK上,所以产生该问题。解决办法即将路径进行更改,Window-Preferences-Java-Installed JRES。如下图:


将jre路径改为jdk路径即可,改动后如下:


此时,重新对maven工程build或test,结果如下:

Results :


Tests run: 1, Failures: 0, Errors: 0, Skipped: 0


[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.272 s
[INFO] Finished at: 2015-09-08T16:10:51+08:00
[INFO] Final Memory: 13M/208M
[INFO] ------------------------------------------------------------------------

运行结果正确,问题解决

[INFO] --- maven-compiler-plugin:2.0.2:compile (default-compile) @ app-oims --- [INFO] Compiling 197 source files to C:\eclipse workspace\workspace-middleware\app-oims\target\classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.307 s [INFO] Finished at: 2025-03-18T14:08:29+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project app-oims: Compilation failure: Compilation failure: [ERROR] C:\eclipse workspace\workspace-middleware\app-oims\src\main\java\com\tti\app\oims\schedule\ScheduleJobTask.java:[17,23] error: cannot find symbol [ERROR] [ERROR] could not parse error message: symbol: class LogIncident [ERROR] location: package com.tti.mdw.util [ERROR] C:\eclipse workspace\workspace-middleware\app-oims\src\main\java\com\tti\app\oims\api\invoke\EFactoryAPI.java:24: error: cannot find symbol [ERROR] import com.tti.mdw.util.LogIncident; [ERROR] ^ [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
03-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值