`
s343174147
  • 浏览: 32577 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Eclipse安装Maven插件后,Eclipse启动问题

 
阅读更多

【maven package】错误:
[INFO] Scanning for projects…[INFO]                                         
[INFO] Building Struts 2 Blank Webapp 1.0-SNAPSHOT[INFO]
[INFO] BUILD FAILURE[INFO]
[INFO] Total time: 0.547s[INFO] Finished at: Wed Apr 13 13:09:48 CST 2011[INFO] Final Memory: 2M/4M[INFO]
[ERROR] Failed to execute goal on project my_struts: Could not resolve dependencies for project ricki.cheung.struts:my_struts:war:1.0-SNAPSHOT: Could not
find artifact com.sun:tools:jar:1.5.0 at specified path C:\Program Files\Java\jre1.6.0_01/../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/DependencyResolutionException
解决方法:
把【Windows】-【Preferences】-【Java】-【Install JREs】中的JRE给remove掉然,后把eclipse中的【Windows】-【Preferences】-【Java】-【Install JREs】改为JDK,而不用JRE
这时候出现另外的问题如下:
Eclipse is running in a JRE, but a JDK is required
  Some Maven plugins may not work when importing projects or updating source folders.
这时的解决方法:
这是因为在Eclipse.ini配置中没有指定-vm参数,修改如下重启Eclipse问题就解决了:

eclipse.ini 写道
-vm
C:\Program Files\Java\jdk1.6.0_10\bin\javaw.exe
 eclipse.ini 修改后
-startup
plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m

-vm
C:\Program Files\Java\jdk1.6.0_10\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics