Eclipse says: “Workspace in use or cannot be created, chose a different one.” How do I unlock a workspace?

When I start, Eclipse says "Workspace Cannot Be Locked"

"Could not launch the product because the associated workspace is currently in use by another Eclipse application." or “Workspace in use or cannot be created, chose a different one.”

But I know it isn't.

How do I "unlock" it?


Solution 1:

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

Precaution - If you delete the .metadata folder all preference will be deleted.

Solution 2:

I've seen 3 other fixes so far:

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

The solution boils down to cleaning up the .metadata folder.