Eclipse Problems View doesn't show Errors

后端 未结 11 1826
[愿得一人]
[愿得一人] 2021-01-17 08:35

[Note: There is another thread about this problem but it did not answer the question.]

For one specific project in Eclipse, the problems view does not show errors. I

相关标签:
11条回答
  • 2021-01-17 09:12

    I'm guessing that the build path for that project is lacking a core library. E.g. if it's a Java project there may not be a JRE/JDK assigned to it.

    For a Java project, check this: Properties > Java Build Path > Libraries (this may differ depending on the version of Eclipse, I'm using 3.2.1 at the moment)

    There should be a JRE or JDK listed here.

    0 讨论(0)
  • 2021-01-17 09:19

    You'll likely need to change the filter on the Problems view to see the errors. There's a downward pointing arrow in the upper right corner of the panel. Click it -> Configure Contents..., and in the Scope make sure "On any element" is selected.

    0 讨论(0)
  • 2021-01-17 09:23

    For anyone else who is having this problem, I have found the answer:

    Make sure that Eclipse recognizes your project as a Java project. Specifically, under Project Properties ensure that you have a Java Builder that is checked.

    That way, your project will be built and you will see errors in the Problems view.

    0 讨论(0)
  • 2021-01-17 09:25

    My problem was that I had a project that I had not edited in a while, so it was linking on a version of the jre that I no longer had on my system. I went to the project properties --> java build path and deleted the reference to the outdated jre.

    0 讨论(0)
  • 2021-01-17 09:26

    I googled this question having same problem, my solution was simply Project -> Clean.

    0 讨论(0)
  • 2021-01-17 09:27

    Here is the solution I use when the red icons do not appear on the project tree to highlight errors in our project files from Eclipse (Windows version).

    Make sure Eclipse is running on the correct JVM. By default, it will use the latest JRE classpath stored in a registry. If you need to run Eclipse from a JDK instead of JRE, you need to tell Eclipse. So, add the -vm option at the top of the eclipse.ini to refer to our preferred JDK as follows:

    -vm 
    C:\Program Files\Java\jdk1.7.0_21/bin/javaw.exe
    

    Remember to change this when you are upgrading your JRE/JDK.

    However, we may encounter issue with Maven complaining about tools.jar in a project's pom.xml. If Eclipse is running on Java JRE instead of JDK, it can be a problem to some Maven plugins like maven-bundle-plugin that still rely on tools.jar which only exists on JDK, causing it to complain. Don't worry about it if your still prefer to run Eclipse using JRE as you can put this entry inside your project's pom.xml to explicitly refer to the right tools.jar:

    <profiles>
        <profile>
            <id>default-profile</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <file>
                    <exists>${java.home}/../lib/tools.jar</exists>
                </file>
            </activation>
            <properties>
                <toolsjar>${java.home}/../lib/tools.jar</toolsjar>
            </properties>
        </profile>
        <profile>
            <id>windows_profile</id>
            <activation>
                <os>
                    <family>Windows</family>
                </os>
            </activation>
            <properties>
                <toolsjar>${java.home}/../lib/tools.jar</toolsjar>
            </properties>
        </profile>
        <profile>
            <id>osx_profile</id>
            <activation>
                <os>
                    <family>mac</family>
                </os>
            </activation>
            <properties>
                <toolsjar>${java.home}/../Classes/classes.jar</toolsjar>
            </properties>
        </profile>
    </profiles>
    
    0 讨论(0)
提交回复
热议问题