Eclipse构建maven项目出错

在使用maven构建项目时遇到了错误,提示找不到Javac Compiler。通过检查JAVA_HOME环境变量,发现指向的是JRE而非JDK。将Eclipse配置中的JRE更改为JDK,并在Eclipse.ini中指定JDK路径,解决了该问题。但随后出现NullPointerException,通过查阅资料和调整设置,最终成功解决问题。
摘要由CSDN通过智能技术生成

 郁闷, 今天用maven构建一个工程,结果抛错,以前用的好好的,大概我重装系统引起的。错误如下:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project ds: Compilation failure
Unable to locate the Javac Compiler in:
  C:/Java/jre1.5.0/../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.

 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:581)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:324)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)
 at org.maven.ide.eclip

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值