Reputation: 75
I've got this kind of error when I try to run my app in Eclipse.
Failed to execute goal on project. Could not resolve dependencies for project pl.wyk:Game-Logic:war:0.0.1-SNAPSHOT: Could not find artifact com.sun:tools:jar:1.8.0_45 at specified path C:\java\jdk/../lib/tools.jar.
But when I try run app from console everything is fine. So what is wrong with Eclipse? I use this same external Maven Runtime.
Upvotes: 1
Views: 1247
Reputation: 75
The problem was with Alternate JRE. You need to choose proper path. In my case:
C:\java\jdk\jre
Upvotes: 0
Reputation: 4533
Try to add your system JDK as Library in Eclipse and use it for the project.
If this doesn't work then you may have to add scope dependency but may cause portability issues:
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.6</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
Upvotes: 1