• Eclipse编译问题


      问题现象:Maven编译ok,Eclipse始终存在编译错误,点了工程的刷新,没用,点了Eclipse上面的菜单Project -> Clean,也没用。后来看了下工作空间项目目录,发现.classpath文件变成了这样:

    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_102"/>
        <classpathentry kind="output" path="bin"/>
    </classpath>

      再找了一个正常的,却是这样的:

    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
        <classpathentry including="**/*.java" 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 excluding="**" kind="src" output="target/test-classes" path="src/test/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 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.6">
            <attributes>
                <attribute name="maven.pomderived" value="true"/>
            </attributes>
        </classpathentry>
        <classpathentry kind="output" path="target/classes"/>
    </classpath>

      另一个.project文件:

    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
        <name>wechat</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
            <buildCommand>
                <name>org.eclipse.jdt.core.javabuilder</name>
                <arguments>
                </arguments>
            </buildCommand>
            <buildCommand>
                <name>org.eclipse.m2e.core.maven2Builder</name>
                <arguments>
                </arguments>
            </buildCommand>
        </buildSpec>
        <natures>
            <nature>org.eclipse.jdt.core.javanature</nature>
            <nature>org.eclipse.m2e.core.maven2Nature</nature>
        </natures>
    </projectDescription>

      正常是工程是这样的:

    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
        <name>tps</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
            <buildCommand>
                <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
                <arguments>
                </arguments>
            </buildCommand>
            <buildCommand>
                <name>org.eclipse.jdt.core.javabuilder</name>
                <arguments>
                </arguments>
            </buildCommand>
            <buildCommand>
                <name>org.eclipse.wst.common.project.facet.core.builder</name>
                <arguments>
                </arguments>
            </buildCommand>
            <buildCommand>
                <name>org.eclipse.wst.validation.validationbuilder</name>
                <arguments>
                </arguments>
            </buildCommand>
            <buildCommand>
                <name>org.eclipse.m2e.core.maven2Builder</name>
                <arguments>
                </arguments>
            </buildCommand>
        </buildSpec>
        <natures>
            <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
            <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
            <nature>org.eclipse.jdt.core.javanature</nature>
            <nature>org.eclipse.m2e.core.maven2Nature</nature>
            <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
            <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
        </natures>
    </projectDescription>

      对比了一下,把正常的内容复制到不正常的文件上去,重新刷新下,问题解决。至于问题怎么导致的,仍是个谜。

  • 相关阅读:
    《陶哲轩实分析》习题10.4.3
    陶哲轩实分析定理10.1.3:导数运算的积法则和商法则
    《数学分析新讲》_张筑生,12.5节:隐函数定理(1)
    《数学分析新讲》_张筑生,12.5节:隐函数定理(1)
    《陶哲轩实分析》定理10.1.15:导数的链法则
    我的博客园的CSS和html设置
    陶哲轩实分析定理10.1.3:导数运算的积法则和商法则
    关于Eclipse中一个错误排查总结
    RMI, Dynamic Proxies, and the Evolution of Deployment
    Java垃圾回收机制浅析
  • 原文地址:https://www.cnblogs.com/wuxun1997/p/9934163.html
Copyright © 2020-2023  润新知