0

I'm using Eclipse version 2019-03 (4.11.0) and I have a project with a big red exclamation mark to the left of the project name. I am not using any dependency management tool, I am managing my dependencies myself manually. The Problems view is telling me that my project is missing a required library, but that jar file is no longer in my list of dependencies for the project (I replaced it with an upgraded version recently, and the problem has existed since then). In case this was a GUI issue I checked the .classpath file for the project in a text editor and it's not listed there. I've also tried cleaning and re-building the project.

This problem is masking compile error and warning icons over the source files in my project. Is there something obvious I've missed? (before I attempt to recreate the project from scratch).

The error listed under the Problems view is:

Project 'MyProject' is missing required library: '/home/me/eclipse-workspaces/work/MyProject/xyz.jar'

The Location is Build Path and the Type is Build Path Problem.

Here's an edited version with the relevant stuff in my .classpath (the supposed missing jar is NOT listed in this file):

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="lib" path="/home/me/eclipse-workspaces/work/MyProject/somelib.jar"/>
    <classpathentry kind="lib" path="/home/me/eclipse-workspaces/work/MyProject/anotherlib.jar"/>
    <classpathentry combineaccessrules="false" kind="src" path="/Enki-Utils"/>
    <classpathentry kind="output" path="bin"/>
</classpath>

The only other Eclipse related file in my project root directory is .project:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
        <name>MyProject</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
                <buildCommand>
                        <name>org.eclipse.jdt.core.javabuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
        </buildSpec>
        <natures>
                <nature>org.eclipse.jdt.core.javanature</nature>
        </natures>
</projectDescription>
RTF
  • 6,214
  • 12
  • 64
  • 132
  • What is the exact error message? Do you have a `module-info.java` file? Please show the content of the `.classpath` file. By the way, your Eclipse is outdated; you are two releases behind (if the upgraded JAR was compiled with Java 13, it cannot be read with that old version). – howlger Jan 07 '20 at 11:05

2 Answers2

1

The solution for me was to close and re-open the project (without restarting Eclipse) which must have flushed out some stale cache. The accepted answer for this question got it for me (with some other possible solutions if that doesn't work).

RTF
  • 6,214
  • 12
  • 64
  • 132
0

on the cmd line run a mvn eclipse:eclipse

magpie
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 15 '23 at 15:39