Aykut Akin
Aykut Akin

Reputation: 143

Eclipse does not show src file

I have three different projects in my eclipse and yesterday src file became unvisible in one of the projects. Two days ago it was ok and I have no idea how this happened. I can not see src file in project explorer or package explorer.

Project Explorer :

Project Explorer

However, if I look with navigator I can see all files in the directories.

Navigator :

Navigator

I use Eclipse Indigo SR2 and IBM Rational ClearCase for first two project. The other is my local test project.

Do anybody know how can I get back to src file into the project explorer?

Thanks.

Upvotes: 11

Views: 34417

Answers (8)

j-m
j-m

Reputation: 1

solved (in Eclipse for me as simple) as

  1. remove src from Java Build Path -> Source

    (how it got there is a blunder, I might have done that myself)

  2. add src/main/java

Thx

Upvotes: 0

Roy
Roy

Reputation: 211

I had the same problem today, it is because i switch to wrong view model.I suggest you to switch the project explorer to Package Explorer.

Upvotes: 8

Anne Smith
Anne Smith

Reputation: 11

I had the same problem in Neon - src folder had disappeared. One sub-directory in the src folder would show up but no other sub-dir and not the parent src file itself. No matter what I did in the buildpath configuration only the one sub-dir would show up. It looked like some kind of corruption in the settings. None of the above solutions worked for me, including deleting the project and all files, and then re-checking it out.

What did work was switching to an old workspace, importing a project and then switching back to the workspace with the issue. Magically, the project with the problem was again responding to my changes in the buildpath configuration. I'm not sure if I had to do the interim step of importing fromt he old workspace or not - possibly just switching back and forth would have worked but not sure.

Upvotes: 1

Thomas Carlisle
Thomas Carlisle

Reputation: 191

I had this problem today, and the issue was that the "src" folder was not correct in the "Source" tab of "Configure Build Path" window. It was there but the path was wrong, so it had a red X. Deleting that entry and re-adding the "src" path (from the project) resulted in putting the "src" folder back into the packages hierarchy.

In my case, this happened because of sharing the workspace between user accounts, the paths to the workspace and the folder beneath were not the same. One user accessed the workspaces locally, the other as a mapped drive, etc.

Fixing this and then standardizing the path to be identical for all who access sit, resolved the underlying problem that caused this issue to surface.

Upvotes: 0

mjedmonds
mjedmonds

Reputation: 51

Try removing (deleting) the project without removing the files (there is a checkbox that allows you to keep the project files).

Then re-import the project. Not sure if this will solve your problem, but I was facing the same issue and delete->re-import resolved it for me.

Upvotes: 0

duslabo
duslabo

Reputation: 1517

Try to right-click on the project and click on refresh.

Upvotes: 16

Mohammod Hossain
Mohammod Hossain

Reputation: 4114

Restart your eclipse work space.

Also change open perspective in eclipse.

Upvotes: -3

Francis Upton IV
Francis Upton IV

Reputation: 19443

Check your Java build path to make sure the src is present. Right click the project and select Build Path -> Configure Build Path. If the src directory is not present in the build path, it will not show up under the Java area as you have shown, but it will be present in the Navigator.

Upvotes: 6

Related Questions