Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse - "Workspace in use or cannot be created, chose a different one." [duplicate]

People also ask

How do I clone a workspace in Eclipse?

Best way is to copy the . metadata folder to a new folder and open that folder in Eclipse Workspace dialog box. Show activity on this post. Just copy the whole workspace on your local file system.

Can you have multiple Eclipse workspaces?

You can't make one Eclipse process work with two different workspaces; it's just not possible. You should launch two different Eclipse processes and open a different workspace in each; one workspace can't be used by two different Eclipse processes either.


Right answer can be found in this (duplicate) question.

I reproduced the answer here (and it works!):

Just delete the .lock file in the .metadata directory in your eclipse workspace directory


I've seen 3 other fixes so far:

  1. in .metadata/, rm .lock file
  2. if 1) doesn't work, try end process javaw.exe etc. to exit the IDE
  3. if 1)&2) doesn't work, try rm .log file in .metadata/, and double check .plugin/.
  4. This always worked for me: relocate .metadata/, open and close eclipse, then overwrite .metadata back

The solution boils down to clean up the .metadata folder with correct contents


Sometimes deleting the .lock file does not work. You can try this:

Remove RECENT_WORKSPACES line from eclipse/configuration/.settings/org.eclipse.ui.ide.prefs


for windows users: In case of you can't remove .lock file and it gives you the following:

enter image description here

And you know that eclipse is already closed, just open Task Manager then processes then end precess for all eclipse.exe occurrences in the processes list.


Workspaces can only be open in one copy of eclipse at once. Further, you took away your own write access from the looks of it. All the users in question have to have the 'admin' group for what you did to even work a little.


Running eclipse in Administrator Mode fixed it for me. You can do this by [Right Click] -> Run as Administrator on the eclipse.exe from your install dir.

I was on a working environment with win7 machine having restrictive permission. I also did remove the .lock and .log files but that did not help. It can be a combination of all as well that made it work.


An additional reason could be that you're pointing to a workspace on a drive that no longer exists, thinking that you're choosing the valid one. For instance, for me the workspace used to exist on the F drive, but now it is on my D drive. Even though I don't have the F drive anymore it is still listed as a workspace I once used during Eclipse startup. When I choose this old workspace Eclipse complains that the workspace is "in use", which is very strange.