问题
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 :
- Eclipse Error: Cannot determine URI for /project-path/
- Eclipse Luna "cannot determine URI for /project/src/com/.../classFile.java" (windows 8)
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 ahistory.index
on each leaves- (does not seem that relevant to my issue)
.markers
is emptystate.dat
is empty.location
contains the stringURI//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 ?
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/30978065/eclipse-be-like-cannot-determine-uri-for-project-name-file-path-file-nam