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>
  • 相关阅读:
    addslashes与mysql_real_escape_string的区别
    gcc
    php函数
    JAVA基本类库介绍
    Linux系统精华教程
    CJIAN
    我的未来不是梦! 全新时代
    html标签属性disabled用法 全新时代
    javamail收取邮件demo code 全新时代
    TortoiseSVN安装注意事项及中文语言包安装 全新时代
  • 原文地址:https://www.cnblogs.com/chenmingjun/p/10740310.html
Copyright © 2011-2022 走看看