首页 > 其他 > 详细

:解决Perhaps you are running on a JRE rather than a JDK?问题

时间:2015-04-15 13:34:35      阅读:131264      评论:0      收藏:0      [点我收藏+]

深圳风采开奖直播 www.nskjr.cn 标签:jdk   eclipse   maven   a jre rather than a   插件   

Maven-No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

技术分享


[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building helloworld 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ helloworld ---
[INFO] Deleting H:\mavenok\helloworld\target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helloworld ---
[INFO] Using ‘UTF-8‘ encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory H:\mavenok\helloworld\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ helloworld ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to H:\mavenok\helloworld\target\classes
[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.781 s
[INFO] Finished at: 2015-03-25T11:22:14+08:00
[INFO] Final Memory: 4M/8M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project helloworld: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[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] //cwiki.apache.org/confluence/display/MAVEN/MojoFailureException


问题描述:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

翻译过来就是,大哥,环境里没给编译器呀,可能你是用jre在玩耍,我要jdk~~


问题原因:eclipse官网看了看,发现eclipse默认是运行在jre上的,
但是maven插件需要使用jdk,因此需要在eclipse修改Installed JRES
位置在-->【Window】-->【Prefrences】-->【Java】-->【Installed JREs】
详见下图。


技术分享


这样就解决了这个问题,重新构建一下


[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building helloworld 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ helloworld ---
[INFO] Deleting H:\mavenok\helloworld\target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helloworld ---
[INFO] Using ‘UTF-8‘ encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory H:\mavenok\helloworld\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ helloworld ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to H:\mavenok\helloworld\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.117 s
[INFO] Finished at: 2015-03-25T11:45:51+08:00
[INFO] Final Memory: 6M/12M
[INFO] ------------------------------------------------------------------------


构建成功。

技术分享








解决Perhaps you are running on a JRE rather than a JDK?问题

标签:jdk   eclipse   maven   a jre rather than a   插件   

原文://blog.csdn.net/yangtzh/article/details/45057273

(14)
(43)
   
举报
评论 一句话评论(0
0条  
登录后才能评论!
? 2014 深圳风采开奖直播 版权所有 鲁ICP备09046678号-4
打开技术之扣,分享程序人生!
             

鲁公网安备 37021202000002号

  • 价值-热门标签-华商生活 2019-05-19
  • 以古鉴今,习近平多次提及屈原 2019-05-18
  • 候选企业:内蒙古蒙草生态环境(集团)股份有限公司 2019-05-18
  • 埃里克森:中国将成为足球大国 15年内能进四强 2019-05-17
  • 审计署:19万套房子空置 数百亿元资金闲置 2019-05-17
  • 广东清远黑臭水体整治弄虚作假 6名责任人被立案调查 2019-05-16
  • 推动实现更高质量和更充分就业 2019-05-15
  • 暴雨突袭石泉 干部背群众转移到安全地带 2019-05-15
  • 人体-热门标签-华商生活 2019-05-14
  • 改革开放40载,互联网的发展风云激荡 2019-05-14
  • 杭州高新区(滨江):“智慧社区”助推社区治理服务创新 2019-05-13
  • 法治中国,走向更美好的明天(砥砺奋进的五年·全面依法治国) 2019-05-13
  • 斯柯达速派2017年上半年累计销量同比上涨36% 2019-05-12
  • 浙江台州副市长出庭应诉民告官案 称要作表率 2019-05-12
  • 罗品禧的专栏作者中国国家地理网 2019-05-11
  • 601| 76| 580| 446| 615| 328| 262| 897| 818| 814|