使用maven打包项目遇到错误: http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

 

今天在使用maven打包项目时遇到一个错误: 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.4:compile (default-compile) on project zjydpt: Fatal error compiling: tools.jar not found: D:\Java\jre7..\lib\tools.jar -> [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/MojoExecutionException 
我使用的是 
C:\Users\Administrator>mvn -v 
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 21:51: 
28+0800) 
Maven home: D:\apache-maven-3.0.5-bin\apache-maven-3.0.5\bin.. 
Java version: 1.7.0_67, vendor: Oracle Corporation 
Java home: D:\Java\jdk1.7.0_67\jre 
Default locale: zh_CN, platform encoding: GBK 
OS name: “windows 7”, version: “6.1”, arch: “amd64”, family: “windows” 
直接从eclipse里面打包会报错可以尝试使用: 
1、在eclipse里面右键项目-run as-maven build-在弹出框Goals里面直接输入clean进行清理 ,然后输入package进行打包,不用加mvn前缀(PS:估计是maven版本问题吧!) 
2、在硬盘里找到你的项目,然后按住shift右键选择‘在此处打开命令窗口’,然后输入mvn clean清理,再输入mvn package进行打包。

我是使用第二种方法进行打包的,打包完成之后发现在eclipse里面重新打包居然可以了 ,很是神奇有木有!!!

 

posted @   QiaoZhi  阅读(10057)  评论(0编辑  收藏  举报
编辑推荐:
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· Obsidian + DeepSeek:免费 AI 助力你的知识管理,让你的笔记飞起来!
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示