What is wrong with my Maven Config?

微笑、不失礼 提交于 2019-12-02 04:59:22
John Vint

Are you running this in eclipse? If the answer is yes, this is an annoying and very misunderstood problem. Take a look at my answer here

You may not be pointing eclipse to the right jre/jdk when you're starting up (this is something you didn't necessarily configure rather was Windows)

A problem I had once was different location of tools.jar under Mac OS. Here's the profiles section to solve the problem:

<profiles>
    <profile>
        <id>java-home-parent-lib-tools-jar</id>
        <activation>
            <activeByDefault>false</activeByDefault>
            <file>
                <exists>${java.home}/../lib/tools.jar</exists>
            </file>
        </activation>
        <dependencies>
            <dependency>
                <groupId>sun.jdk</groupId>
                <artifactId>tools</artifactId>
                <version>1.5.0</version>
                <scope>system</scope>
                <systemPath>${java.home}/../lib/tools.jar</systemPath>
            </dependency>
        </dependencies>
    </profile>
    <profile>
        <id>java-home-parent-classes-classes-jar</id>
        <activation>
            <activeByDefault>false</activeByDefault>
            <file>
                <exists>${java.home}/../Classes/classes.jar</exists>
            </file>
        </activation>
        <dependencies>
            <dependency>
                <groupId>sun.jdk</groupId>
                <artifactId>tools</artifactId>
                <version>1.5.0</version>
                <scope>system</scope>
                <systemPath>${java.home}/../Classes/classes.jar</systemPath>
            </dependency>
        </dependencies>
    </profile>
</profiles>

However I am not sure this is something you're facing.

Chris

If your JAVA_HOME points to your jdk (e.g./usr/lib/jvm/jdk1.6.0_33), your tools.jar configuration (${java.home}/../lib/tools.jar) indicates that there should be a tools jar with the following path: /usr/lib/jvm/lib/tools.jar.

If you change the tools jar path to ${java.home}/lib/tools.jar and verify that in your JAVA_HOME/lib there is the tools.jar file, it should work.

There you can find the related jira.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!