volni
volni

Reputation: 5366

Eclipse Problems View doesn't show Errors

[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. It shows warnings but it does not show errors. The other projects do show errors (and everything else). For that problematic project, I can see the red squiggly error line in the files. However, the directory structure does not show an error icon and the error is not populated in the Problems View.

Any ideas?

Upvotes: 20

Views: 47694

Answers (12)

mwarren
mwarren

Reputation: 2479

I had this mysterious problem in my new installation of Spring Tool Suite 4.

Then I realized that most of the columns in the problems view had been reduced to zero width for some weird reason.

So I just had to drag in the columns from the left and everything appeared.

Upvotes: 0

Alexander Pogrebnyak
Alexander Pogrebnyak

Reputation: 45606

I want to post my story here if Google brings you to this question.

Somehow, "Project->Build Automatically" got turned off.

enter image description here

Turning it back on produces correct errors list.

I've tested that this is the case as far as Ganymede ( at the point of writing this post I am running Indigo )

Upvotes: 17

egilchri
egilchri

Reputation: 761

I am a newbie to STS, and I had a similar problem. Errors weren't showing up until I saved the file. I discovered it was because I was using the Text Editor, instead of the Java Editor.

Upvotes: 0

user1861650
user1861650

Reputation: 1

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.

Upvotes: 0

Sanket Mehta
Sanket Mehta

Reputation: 622

I checked the .classpath file of the Eclipse project. It had incorrect value of src so it was pointing to the wrong source of Java files.

My files incorrect entry:

<classpathentry kind="src" path="src"/>

I changed it to the correct entry:

<classpathentry kind="src" path="source/java"/>

Now it is working.

Upvotes: 2

ecle
ecle

Reputation: 4000

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>

Upvotes: 0

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

Upvotes: 2

lini sax
lini sax

Reputation: 921

I had the problem where in the red cross icon by the file name did not appear. I tried all possibilities described on this question. However, the root cause in my case was, I deleted a jar file from SVN. So the java file using the imports from this jar had errors. Surprisingly that didn't show up.

Looking at the build path, I found under Java Build Path -> Libraries -> jar (missing). Having removed it from the build path, the red icon next to the file showed up !! Excruciating it was to find this error and wasting so much time, I wonder why this icon does not show up nor does Problem view report it.

Upvotes: 3

volni
volni

Reputation: 5366

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.

Upvotes: 15

Chris
Chris

Reputation: 3529

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.

Upvotes: 0

Neal Swearer
Neal Swearer

Reputation: 2572

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.

Upvotes: 3

Related Questions