Shi*_*abu 22 java maven java-7
我在eclipse中使用maven创建了一个webapp项目.当我在命令提示符下运行命令mvn package时,它显示以下错误.
[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: 4.310s
[INFO] Finished at: Tue Mar 05 14:32:23 IST 2013
[INFO] Final Memory: 16M/218M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project Compilation fa
ilure
[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] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Run Code Online (Sandbox Code Playgroud)
我试图改变jdk和jre.但没有工作.它仍显示相同的错误
Sym*_*Sym 48
在Windows 7 - 64位中,存在权限问题,导致安装程序无法将文件解压缩C:\Program Files\Java\jdk1.6.xx\lib\tools.jar到本地.这个jar文件是maven-compiler-plugin3.x使用的版本,而不是通常的版本javac
解决方案:
以管理员身份运行Java JDK安装程序!并确保tools.jar它坐在C:\Program Files\Java\jdk1.6.xx\lib\
如果您使用m2e maven集成插件,您希望通过Eclipse中的以下步骤看到Eclipse可以看到该文件:
然后通过以下步骤配置maven运行:
| 归档时间: |
|
| 查看次数: |
66944 次 |
| 最近记录: |