Eclipse - “工作区正在使用或无法创建,请选择不同的工作区。”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7465793/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse - "Workspace in use or cannot be created, chose a different one."
提问by Hristo
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.
我试图在/Users/Shared/
目录中创建一个工作区,认为我可以在用户之间共享该工作区。问题是,在我创建工作区并更改其权限后,我遇到了下面的错误(图像),甚至没有切换到其他用户。
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?
那么我在这里做错了什么?我应该如何配置这个工作区,以便我可以 1. 摆脱错误消息,2. 从两个帐户访问它而不会看到错误消息?
By the way, I'm working on Mac OS X Lion v10.7.1.
顺便说一下,我正在使用 Mac OS X Lion v10.7.1。
回答by jap1968
回答by txs
I've seen 3 other fixes so far:
到目前为止,我已经看到了其他 3 个修复程序:
- in .metadata/, rm .lock file
- if 1) doesn't work, try end process javaw.exe etc. to exit the IDE
- if 1)&2) doesn't work, try rm .log file in .metadata/, and double check .plugin/.
- This always worked for me: relocate .metadata/, open and close eclipse, then overwrite .metadata back
- 在 .metadata/, rm .lock 文件
- 如果 1) 不起作用,请尝试结束进程 javaw.exe 等以退出 IDE
- 如果 1)&2) 不起作用,请尝试 .metadata/ 中的 rm .log 文件,并仔细检查 .plugin/。
- 这总是对我有用:重新定位 .metadata/,打开和关闭 eclipse,然后将 .metadata 覆盖回来
The solution boils down to clean up the .metadata folder with correct contents
解决方案归结为使用正确的内容清理 .metadata 文件夹
回答by yildirimyigit
Sometimes deleting the .lock file does not work. You can try this:
有时删除 .lock 文件不起作用。你可以试试这个:
Remove RECENT_WORKSPACESline from eclipse/configuration/.settings/org.eclipse.ui.ide.prefs
从eclipse/configuration/.settings/org.eclipse.ui.ide.prefs 中删除RECENT_WORKSPACES行
回答by Muhammed Refaat
for windows users: In case of you can't remove .lock
file and it gives you the following:
对于 Windows 用户:如果您无法删除.lock
文件,它会为您提供以下信息:
And you know that eclipse is already closed, just open Task Managerthen processesthen end precess
for all eclipse.exeoccurrences in the processes list.
而你知道,日食已经关闭,只需打开任务管理器,然后进行处理,然后end precess
对所有的eclipse.exe出现在进程列表。
回答by bmargulies
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.
工作区一次只能在一个 eclipse 副本中打开。此外,您从它的外观中剥夺了自己的写访问权限。所有有问题的用户都必须拥有“管理员”组才能完成您所做的工作,甚至可以做一点工作。
回答by Nikhilesh Gargi
Running eclipse in Administrator Mode
fixed it for me. You can do this by [Right Click] -> Run as Administratoron the eclipse.exe
from your install dir.
运行 eclipseAdministrator Mode
为我修复了它。您可以通过[右键单击] ->在eclipse.exe
安装目录中以管理员身份运行来执行此操作。
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.
我在具有限制性权限的 win7 机器的工作环境中。我也确实删除了.lock
和.log
文件,但这没有帮助。它也可以是使其工作的所有组合。
回答by Raoul
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.
另一个原因可能是您指向驱动器上不再存在的工作区,认为您选择的是有效的工作区。例如,对我来说,工作区曾经存在于 F 盘上,但现在它在我的 D 盘上。即使我不再有 F 驱动器,它仍然被列为我在 Eclipse 启动期间曾经使用过的工作区。当我选择这个旧工作区时,Eclipse 抱怨工作区“正在使用”,这很奇怪。
回答by Brad Mace
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.
就我而言,这发生在插件开发期间从我的主 Eclipse 会话运行的 Eclipse 测试实例上。一个错误导致 gui 消失,但并没有完全杀死它。按下控制台中的停止按钮即可解决问题。
回答by tok
Check that you have enough rights to workspace directory. I got this error when I didn't have write permission to workspace.
检查您对工作区目录是否有足够的权限。当我没有工作区的写权限时,我收到了这个错误。
回答by Suresh Babu
Go to TaskManager(Right Click in the Task Bar) and select Processess menu bar and select eclipse.exe and Click EndProcess
转到 TaskManager(在任务栏中右键单击)并选择 Processess 菜单栏并选择 eclipse.exe 并单击 EndProcess