构建错误:缺少工件com.sun:tools:jar:1.6 [英] Build error: missing artifact com.sun:tools:jar:1.6

查看:222
本文介绍了构建错误:缺少工件com.sun:tools:jar:1.6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试构建PlayN示例项目:

Trying to build PlayN sample projects I get:

Missing artifact com.sun:tools:jar:1.6  pom.xml /playn-cute line 6  Maven Dependency Problem

在每个 pom.xml 文件。
如何解决?

On every pom.xml file. How do I resolve it?

修改

I已将配置文件节点添加到 pom.xml ,但错误仍然存​​在。我检查了 tools.jar 实际上是否存在,但事实并非如此。所以我在lib文件夹中添加了 tools.jar 。仍然是错误。

I've added the profiles node to the pom.xml, but the error remains. I've checked the tools.jar is actually exists, and it didn't. So I've added tools.jar to lib folder. And still the error remains.

完整的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.googlecode.playn</groupId>
        <artifactId>playn-project</artifactId>
        <version>1.0.1</version>
    </parent>

    <artifactId>playn-cute</artifactId>
    <name>PlayN Cute Metaproject</name>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <properties>
        <playn.version>1.0.1</playn.version>
    </properties>

    <modules>
        <module>core</module>
        <module>java</module>
        <module>html</module>
        <!-- <module>flash</module> -->
        <module>android</module>
    </modules>

    <profiles>
        <profile>
            <id>default-tools.jar</id>
            <activation>
                <property>
                    <name>java.vendor</name>
                    <value>Sun Microsystems Inc.</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.sun</groupId>
                    <artifactId>tools</artifactId>
                    <version>1.6</version>
                    <scope>system</scope>
                    <systemPath>${java.home}/../lib/tools.jar</systemPath>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>


推荐答案

此工件始终作为系统依赖项处理。它永远不会存储在回购中。

This artifact is always handled as a 'system' dependency. It is never stored in a repo.

请参阅 http:/ /maven.apache.org/general.html#tools-jar-dependency 了解详情。

如果没有工具罐,你就是'在Mac上,当需求是JDK时,您正在尝试使用JRE。您无法通过复制文件将其中一个转换为另一个。

if there is no tools jar, and you aren't on a Mac, you are trying to use a JRE when the requirement is a JDK. You can't turn one into the other by copying file.

这篇关于构建错误:缺少工件com.sun:tools:jar:1.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆