raptor496
raptor496

Reputation: 267

pom file java tools.jar issue

I execute

mvn install

And get the following error:

[ERROR] Failed to execute goal on project 1: Could not resolve dependencies for project 1:1:jar:0.0.1-SNAPSHOT: Could not find artifact 
com.sun:tools:jar:1.6.0 at specified path C:\Program Files\Java\jdk1.7.0_21\lib -> [Help 1]

This is how I'm specifying location for tools.jar:

<profiles>
<profile>
    <id>windows_profile</id>
    <activation>
        <activeByDefault>false</activeByDefault>
        <os>
            <family>windows</family>
        </os>
    </activation>
    <properties>
        <toolsjar>C:\Program Files\Java\jdk1.7.0_21\lib</toolsjar>
    </properties>
    <dependencies>
        <dependency>
            <groupId>com.sun</groupId>
            <artifactId>tools</artifactId>
            <version>1.6.0</version>
            <scope>system</scope>
            <systemPath>${toolsjar}</systemPath>
        </dependency>
    </dependencies>
</profile>
</profiles>

Maybe I should specify the full path here?

 <systemPath>${toolsjar}</systemPath>

Upvotes: 0

Views: 249

Answers (1)

3141
3141

Reputation: 148

You need to specify the path to the jar itself, not to the directory containing the jar.

<properties>
    <toolsjar>C:\Program Files\Java\jdk1.7.0_21\lib</toolsjar>
</properties>

should be something like

<properties>
    <toolsjar>C:\Program Files\Java\jdk1.7.0_21\lib\tools.jar</toolsjar>
</properties>

Upvotes: 1

Related Questions