Eclipse 说:“工作区正在使用或无法创建,请选择其他工作区。” 如何解锁工作区?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8489322/
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 says: “Workspace in use or cannot be created, chose a different one.” How do I unlock a workspace?
提问by Roger C S Wernersson
When I start, Eclipse says "Workspace Cannot Be Locked"
当我开始时,Eclipse 显示“无法锁定工作区”
"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.”
“无法启动产品,因为关联的工作区当前正被另一个 Eclipse 应用程序使用。” 或“工作区正在使用或无法创建,请选择其他工作区。”
But I know it isn't.
但我知道不是。
How do I "unlock" it?
我如何“解锁”它?
回答by Boris
Just delete the .lock
file in the .metadata
directory in your eclipse workspace directory.
只需删除eclipse 工作区目录中目录中的.lock
文件即可.metadata
。
Precaution- If you delete the .metadata
folder all preference will be deleted.
注意事项- 如果您删除.metadata
文件夹,所有首选项都将被删除。
回答by txs
I've seen 3 other fixes so far:
到目前为止,我已经看到了其他 3 个修复程序:
- in .metadata/, rm .lock file
- if #1 doesn't work, try killing the process javaw.exe etc. then rm .lock file
- if #1 and #2 don't work, try rm .log file in .metadata/, and double check .plugin/.
- This has always worked for me: relocate .metadata/, open and close eclipse, then overwrite .metadata back
- 在 .metadata/, rm .lock 文件
- 如果 #1 不起作用,请尝试终止进程 javaw.exe 等,然后 rm .lock 文件
- 如果 #1 和 #2 不起作用,请尝试 .metadata/ 中的 rm .log 文件,并仔细检查 .plugin/。
- 这一直对我有用:重新定位 .metadata/,打开和关闭 eclipse,然后将 .metadata 覆盖回来
The solution boils down to cleaning up the .metadata folder.
解决方案归结为清理 .metadata 文件夹。
回答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
回答by smueller1245
Another possible cause of the “Workspace in use or cannot be created, chose a different one” issue is that the real path to your workspace may have changed.
“工作区正在使用或无法创建,选择不同的工作区”问题的另一个可能原因是工作区的真实路径可能已更改。
In my case, the real location of the workspace had changed, but I had used a symlink to make it look like it was in the same location. I saw errors in logs indicating that eclipse was looking at the previous "real" location, as opposed to following the symlink, and this was causing the errors.
就我而言,工作区的实际位置已更改,但我使用了符号链接使其看起来像是在同一位置。我在日志中看到错误,表明 eclipse 正在查看以前的“真实”位置,而不是跟随符号链接,这导致了错误。
In my case, I just moved the workspace back to its old location.
就我而言,我只是将工作区移回了旧位置。
回答by kakyo
There is another case where the path to the workspace may not exist, e.g., if you have imported preferences from another workspace, then some imported workspace addresses may appear in your "open workspace" dialog; then if you didn't pay attention to those addresses, you would get the exact same error once you tried to open them.
还有另一种情况,工作区的路径可能不存在,例如,如果您从另一个工作区导入了首选项,那么某些导入的工作区地址可能会出现在您的“打开工作区”对话框中;那么如果你不注意这些地址,一旦你试图打开它们,你就会得到完全相同的错误。
回答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 Daniel Adenew
Another possible case if none works is to see that there is a running Java
application . may be your previous open and close has left unkilled java instances.
如果没有任何效果,另一种可能的情况是查看正在运行的Java
应用程序。可能是您之前的打开和关闭留下了未杀死的 java 实例。
Do look for any java instance is running if there are two at least you need to kill one.But ,most of the time i kill any java running :) because that java is using the work space earlier and still will if don't kill it.
Change another work space in case if you want a multiple IDE to use and work on diffrent or same project , but you should import project form workspace after you open your IDE.
如果至少有两个你需要杀死一个,请寻找任何正在运行的 java 实例。但是,大多数时候我会杀死任何正在运行的 java :) 因为那个 java 正在使用工作空间,如果不杀死它仍然会它。
如果您希望多个 IDE 使用并处理不同或相同的项目,请更改另一个工作空间,但您应该在打开 IDE 后导入项目表单工作空间。
回答by user2574523
At times, if you are on Windows, you may not see all the processes - or the culprit process in Task manager. I had to click 'Show process from all users' and there was this java.exe that I had to kill in order to get back my workspace.
有时,如果您使用的是 Windows,您可能看不到所有进程 - 或任务管理器中的罪魁祸首进程。我必须单击“显示所有用户的进程”,并且必须杀死这个 java.exe 才能取回我的工作区。
回答by Venkata Naresh Babu
i was faced this issue when ever the eclipse is not closed (kill eclipse process the from task manager or computer power off), i was tried below steps, it worked for me.
当 eclipse 没有关闭时,我就遇到了这个问题(从任务管理器中杀死 eclipse 进程或关闭计算机电源),我尝试了以下步骤,它对我有用。
1) Remove the file names start with ".fileTable" from this folder
1) 从此文件夹中删除以“.fileTable”开头的文件名
C:\eclipse\configuration\org.eclipse.osgi.manager
C:\eclipse\configuration\org.eclipse.osgi.manager
2) Remove the log files like text files start with numeric names from this folder
2) 从此文件夹中删除以数字名称开头的文本文件等日志文件
C:\eclipse\configuration
C:\日食\配置
3) Open Command prompt(cmd) navigate to this folder
3)打开命令提示符(cmd)导航到这个文件夹
C:\eclipse
C:\日食
type below command
输入以下命令
eclipse clean start
日食干净的开始
回答by user4112061
deleting logs and .lock didn't work but
删除日志和 .lock 没有用,但是
-cleanoption fixed it for me.
-clean选项为我修复了它。