最近上课讲eclipse 中的maven插件 有一个坑确实比较坑,实际上就是一个配置的原因。

就是在eclipse中设置java 的buildpath的时候,一般不注意往往都设置成了jre的,这样的话在运行的时候总会遇到问题,比如同学使用cobetura插件的时候会遇到这个错误:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project secondjavahomework: Fatal error compiling: tools.jar not found: C:\Program Files\Java\jre8\..\lib\tools.jar -> [Help 1]

这个时候记住要把路径改成jdk的而不是jre的这样才能正确的运行,因为那个tools.jar在jdk的路径下面,不在jre的路径下面。

相关文章:

  • 2021-04-20
  • 2021-09-12
  • 2021-11-12
  • 2021-12-14
  • 2021-07-19
  • 2021-12-29
  • 2021-11-02
  • 2022-12-23
猜你喜欢
  • 2021-10-25
  • 2022-12-23
  • 2021-11-20
  • 2021-05-30
  • 2021-04-25
  • 2021-06-25
  • 2021-09-22
相关资源
相似解决方案