10

Main issue :

I've encountered the following error on Eclipse Luna :

You come one day at work and try to launch eclipse and be productive but as soon as your workbench opens you see that all your file tabs are in error like :

Cannot determine URI for 'my-project/path/to/file/filename.extension'

And if I check in my navigator/explorer views I see none of my projects.

The first couple times I did as recomended to other people who faced the same problem :

I re-created my projects under eclipse.


But :

  • the project has grown bigger (more and more sub-projects to re-create each time)
  • this problem is growing more and more frequent
  • I am growing weary of the manual work it requires

So I am not satisfied with the solution at hand.

Therefore I am looking for a some sort of way to fix this issue automatically (with come sort of script or set of command lines) or at least some way to prevent this from happening.


My progression so far :

I have delved into the workspace folder :

workspace
└── .metadata
    └── .plugins
        └── org.eclipse.core.resources
            └── .projects
                ├── project1-newName
                ├── project1-oldName
                ├── project2-newName
                └── project2-oldName

So my projects's metadas are still there !?

If I dig a bit further I see that each and every folder is organized as follows

.
├── .indexes
│   └── [...]
├── .location
├── .markers
├── org.eclipse.jdt.apt.core
└── org.eclipse.jdt.core
    └── state.dat

Where

  • .indexes contains a fat-mambo-jambo-of-split-index-tree-organization containing a history.index on each leaves
    • (does not seem that relevant to my issue)
  • .markers is empty
  • state.dat is empty
  • .location contains the string URI//file:/home/myname/projects/my/project/source/folder amidst some scramble chars like @��#%�磓

I'm pretty sure that the solution lies within this .location file.


Conclusion :

Has anyone any clue as to why eclipse can't suddenly read it's own files and How to make it see and recognise them again ?

Community
  • 1
  • 1
Ar3s
  • 2,237
  • 2
  • 25
  • 47

2 Answers2

14

You can solve the problem by trying this:

  • Right click Package Explorer
  • Select Import
  • General > Existing Projects into Workspace > Navigate to the project
    folder(Select root directory)
    > select the Project.
  • Finish. This will certainly solve your problem.

If this doesn't work proceed to File System (General>FileSystem) and select the project files.

First method is quite easy and works perfectly in most cases.

Smug
  • 151
  • 1
  • 6
  • Thanks but turns out that in one year of time I got fed up with eclipse, turned to intelliJ, my mission ended so I don't have access to the flawed computer any more :( – Ar3s Jul 18 '16 at 15:05
  • 2
    I moved to intelliJ myself. – Smug Jun 05 '20 at 15:39
5

I faced the same issue. The above suggested method does not work in my case as Package Explorer -> Export option remains disabled. So I chose to create another workspace in Eclipse and followed the steps Import-> General -> Existing Projects into Workspace.

It worked fine after the Build Workspace was complete.

Panciz
  • 2,183
  • 2
  • 30
  • 54
Ravi Agrawal
  • 51
  • 1
  • 2