zoukankan      html  css  js  c++  java
  • 【Eclipse】出现 'Setting build path' has encountered a problem 的解决方法

    今天,我在修改Eclipse项目的 JRE 环境时,老是报这个错误,很纳闷,到底是由于什么原因,导致的这个问题:

      

    后面发现了,是在这个项目里面的 .classpath 的这个文件有问题,所以对待这个问题的解决的方法就是:

    可以新建一个类似的项目,然后把那个项目中的 .classpath 的替换进来,然后重启 Eclipse 就可以了!

    新的 .classpath 文件你内容如下:

    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
        <classpathentry kind="src" output="target/classes" path="src/main/java">
            <attributes>
                <attribute name="optional" value="true"/>
                <attribute name="maven.pomderived" value="true"/>
            </attributes>
        </classpathentry>
        <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
            <attributes>
                <attribute name="maven.pomderived" value="true"/>
            </attributes>
        </classpathentry>
        <classpathentry kind="src" output="target/test-classes" path="src/test/java">
            <attributes>
                <attribute name="optional" value="true"/>
                <attribute name="maven.pomderived" value="true"/>
            </attributes>
        </classpathentry>
        <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
            <attributes>
                <attribute name="maven.pomderived" value="true"/>
            </attributes>
        </classpathentry>
        <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
            <attributes>
                <attribute name="maven.pomderived" value="true"/>
            </attributes>
        </classpathentry>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_192"/>
        <classpathentry kind="output" path="target/classes"/>
    </classpath>

    出现错误的.classpath 文件内容如下:

    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
        <classpathentry kind="src" output="target/classes" path="src/main/java">
            <attributes>
                <attribute name="optional" value="true"/>
                <attribute name="maven.pomderived" value="true"/>
            </attributes>
        </classpathentry>
        <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
            <attributes>
                <attribute name="maven.pomderived" value="true"/>
            </attributes>
        </classpathentry>
        <classpathentry kind="src" output="target/test-classes" path="src/test/java">
            <attributes>
                <attribute name="optional" value="true"/>
                <attribute name="maven.pomderived" value="true"/>
            </attributes>
        </classpathentry>
        <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
            <attributes>
                <attribute name="maven.pomderived" value="true"/>
            </attributes>
        </classpathentry>
        <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
            <attributes>
                <attribute name="maven.pomderived" value="true"/>
            </attributes>
        </classpathentry>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
            <attributes>
                <attribute name="maven.pomderived" value="true"/> <!-- 这个配置项是多余的 -->
            </attributes>
        </classpathentry>
        <classpathentry kind="output" path="target/classes"/>
    </classpath>
  • 相关阅读:
    [CSP-S模拟测试]:迷宫(最短路)
    [CSP-S模拟测试]:五子棋(模拟)
    [CSP-S模拟测试]:点亮(状压DP+树上背包DP)
    [CSP-S模拟测试]:统计(树状数组+乱搞)
    [CSP-S模拟测试]:组合(欧拉路)
    [CSP-S模拟测试]:笨小猴(随机化)
    最小表示法
    BZOJ4868 [Shoi2017]期末考试 【三分 + 贪心】
    BZOJ4870 [Shoi2017]组合数问题 【组合数 + 矩乘】
    BZOJ4919 [Lydsy1706月赛]大根堆 【dp + 启发式合并】
  • 原文地址:https://www.cnblogs.com/chenmingjun/p/10740310.html
Copyright © 2011-2022 走看看