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>
  • 相关阅读:
    Python 简单的方法爬取b站dnf视频封面
    Opencv学习(一)
    某个代码
    2017年江西理工大学C语言程序设计竞赛(高级组)
    2017年江西理工大学C语言程序设计竞赛(初级组)
    两数相除
    华东交通大学2017年ACM“双基”程序设计竞赛 1009
    华东交通大学2017年ACM“双基”程序设计竞赛 1005
    UE4联机多人游戏基本设置
    菜鸟学习物联网---辨析基于Andriod 5.1,Linux,Windows10开发Dragon Board 410c板
  • 原文地址:https://www.cnblogs.com/chenmingjun/p/10740310.html
Copyright © 2011-2022 走看看