创建博客 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

大道至简

努力,奋进,向上。

 
 
 

日志

 
 

http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException(使用MAVEN遇到的Exception)  

2011-03-08 17:33:37|  分类: 编程 |  标签: |举报 |字号 订阅


Exception再现:
在eclipse的项目中 pom.xml文件右键 -- Run As -- Maven package 

Console提示:
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for sofa-foundation-app:sofa-foundation-app:war:1.0
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 36, column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. @ line 29, column 12
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building sofa-foundation-app 1.0
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact jca:jca:jar:1.5 has been relocated to javax.resource:connector-api:jar:1.5
[INFO] 
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ sofa-foundation-app ---
[INFO] Using 'GBK' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 11 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ sofa-foundation-app ---
[INFO] Compiling 11 source files to E:\workspace\eclipse\sofa-foundation-app\WebContent\WEB-INF\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Unable to locate the Javac Compiler in:
  C:\Program Files\Java\jre6\..\lib\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.687s
[INFO] Finished at: Tue Mar 08 17:16:50 CST 2011
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project sofa-foundation-app: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] C:\Program Files\Java\jre6\..\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.
[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


解决方案: 
1.Window -- Preferences -- Java -- Installed JREs  
  新建一个 JRE [引用JDK的JRE文件夹] 将新建的选中
2.点击Installed JREs 下面的Execution Environments
  在执行环境列表点击  JavaSE - 1.6(我的JDK就是1.6的) 在兼容的JRE列表中选中JDK的JRE(刚才新增的)
  评论这张
 
阅读(3781)| 评论(2)
|      
推荐 转载

历史上的今天

最近读者

热度

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2014