java项目pom文件不见了,在Java项目的pom.xml中,我丢失了工件jdk.tools:jdk.tools:jar:1.6错误...

I think I know how to solve the problem except: I don't know where in the pom the specific version is referred to (I do not see it explicitly) and the solution I have seen is to add this dependency:

com.sun

tools

1.6

system

C:\Program Files\Java\jdk1.6.0_29\lib\tools.jar

But I would like to use com.oracle and the jdk directory on Windows is jdk1.8.

So is there a way to make the pom "want" the version of tools that I actually have on my machine?

解决方案

I finally tackled this the proper way.

This happens when eclipse is launched with the JRE instead of the JDK as tools.jar isn't in the JRE.

Based on that assertion, try installing the JDK. If it's already installed, check in your Path that you have the JDK path and not the JRE path.

Be careful, the latest versions of java seems to add in the Path the following directory: C:\ProgramData\Oracle\Java\javapath. It contains shortcuts that may link to the JRE. You'll want to remove that and add in the link to your JDK bin folder. (e.g. C:\Program Files\Java\jdk1.8.0_66\bin)

Note that you may need to restart your computer for the changes in the Path to be effective for the eclipse launch (I don't really understand why I had to but I did).

Also note that Java updates will probably re-add the javapath to your PATH. So you may want not to use auto-updates but instead manually update your JDK and adapt your path after the install. It's a bit heavy but does the work.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值