Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse: The project was not built since the source file ... could not be read

Tags:

eclipse

When compiling my Java project, I get this error in Other errors:

Description Resource    Path    Location    Type
The project was not built since the source file /PROJECT/src/main/org/../ABC.java could not be read PROJECT     Unknown Java Problem

Indeed, the file is listed in Package Explorer but shows only "Error retrieving content description. On the file system, the silent dir exists but not the file; git status is missing nothing. How do I resolve that compile error?

like image 339
rwst Avatar asked May 28 '12 14:05

rwst


2 Answers

Simply restart eclipse, refresh all projects and do a clean build. That should fix it. Don't forget the eclipse restart, else no matter how many times you do a clean build or refresh, it will not fix the problem

like image 99
Abbas Gadhia Avatar answered Oct 21 '22 10:10

Abbas Gadhia


Looks like someone has deleted that file but eclipse still think that file is part of the project. Might have happened when someone deleted a file from the source control in an improper way.

If you dont have pending changes then you can get fresh copy of the project and import it into your workspace.

If you have pending changes then take a copy of changes and repeat above step. ( A restart of eclipse may be necessary)

like image 2
Jeevan Avatar answered Oct 21 '22 09:10

Jeevan