219

I'm trying to create a workspace in the /Users/Shared/ directory with the thought that I can share that workspace between users. The problem is that after I create the workspace and change the permission on it, I encounter the error below (image) without even switching to a different user.

I changed the permissions from

/Users/Shared $ ll
drwxr-xr-x  3 HristoOskov  wheel   102 Sep 18 20:07 myWorkspace

... to...

/Users/Shared $ ll
drwxrwxr-x  3 root         admin   102 Sep 18 19:45 myWorkspace

So what am I doing wrong here? How should I configure this workspace so that I can 1. get rid of the error message and 2. access it from both accounts without seeing the error message?

By the way, I'm working on Mac OS X Lion v10.7.1.

error

Hristo
  • 45,559
  • 65
  • 163
  • 230
  • 10
    See: http://stackoverflow.com/questions/8489322/eclipse-says-workspace-in-use-or-cannot-be-created-chose-a-different-one-ho – Quetzalcoatl Sep 25 '12 at 08:43

10 Answers10

501

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

Andrew G. Johnson
  • 26,603
  • 30
  • 91
  • 135
jap1968
  • 7,747
  • 1
  • 30
  • 37
42

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

txs
  • 989
  • 8
  • 12
18

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

yildirimyigit
  • 3,013
  • 4
  • 25
  • 35
  • 1
    excellent solution. I host eclipse on a removable drive and when the drive letter changes, this is the solution that will fix it. – DMortensen Jan 14 '15 at 15:37
  • This did it for me. On Mac the file to edit is /Applications/Eclipse.app/Contents/Eclipse/configuration/.settings/org.eclipse.ui.ide.prefs – zeroimpl Jun 16 '21 at 02:19
13

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.

Muhammed Refaat
  • 8,914
  • 14
  • 83
  • 118
6

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.

bmargulies
  • 97,814
  • 39
  • 186
  • 310
  • Well, the one copy of Eclipse is easily solvable... I'll close it in UserA and open a new instance in UserB. Regarding the `admin`, I am an administrative user on my computer. Granted I don't understand much about these user groups, but I think being an admin should work. I just changed some stuff and it seems like the problem is not `admin`, its `root`. – Hristo Sep 19 '11 at 02:22
  • Running eclipse again in Administrator rights made it work again, thanks! – Michael De Keyser Jun 25 '14 at 00:06
2

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.

NicolasMoise
  • 7,261
  • 10
  • 44
  • 65
1

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.

Raoul
  • 133
  • 3
  • 15
0

In my case this occurred on a test instance of Eclipse run from my main Eclipse session during plugin development. An error caused the gui to disappear, but didn't totally kill it. Hitting the stop button in the console took care of it.

Brad Mace
  • 27,194
  • 17
  • 102
  • 148
0

Check that you have enough rights to workspace directory. I got this error when I didn't have write permission to workspace.

tok
  • 909
  • 1
  • 10
  • 21
-1

Go to TaskManager(Right Click in the Task Bar) and select Processess menu bar and select eclipse.exe and Click EndProcess

Suresh Babu
  • 211
  • 2
  • 2