当我启动时,Eclipse显示“工作区不能被锁定”

“无法启动产品,因为相关的工作空间目前正在被另一个Eclipse应用程序使用”或“工作空间正在使用或无法创建,请选择另一个工作空间。”

但我知道它不是。

我如何“解锁”它?


当前回答

下面是解决这个问题的几个步骤。4步对我来说很有用。

Delete .log files along .metadata folder. Check the current user permission make sure to check the full control checkbox click apply then OK. If you run system drive defragmentation or maintenance before you run eclipse editor sometimes original file path are not in their respective path to make sure run "previous version" time before your system maintenance of your drive where the eclipse workbench or something similar to this was saved. This last option is works for me. Check the drive letter of your current drive where the code editor was saved. If something unusual e.g before your maintenance your drive letter is K then after defragment or maintenance. The drive letter is now L hence you should change the drive letter to its original one that is K. to do this click the ff: Open control panel System & security Administrative tools Computer management Disk management in disk mngt choose the Drive example L then right click > change drive letter & path > click remove > then ok, open it again then > click add and > choose your original drive letter for that drive then click ok. If you use your computer for a long period of time do restart first to refresh everything.

其他回答

只需删除eclipse工作区目录中的.metadata目录中的.lock文件。

注意事项-如果你删除。metadata文件夹,所有的首选项都会被删除。

Mac用户:

可能是另一个eclipse实例正在后台运行。如果是,使用Force Quit eclipse或

ps -ef |grep eclipse
kill -9 pid

到所有eclipse实例,并启动新的工作空间

进入任务管理器(在任务栏中单击右键),选择进程菜单栏,选择eclipse.exe,单击EndProcess

我在重启系统(经过很长时间后)后出现了这个错误。通常我只是让它睡觉)。 我发现一旦我挂载了项目文件夹所在的驱动器(通过单击并打开它),并重新启动eclipse,就为我解决了这个问题。

PS:我是ubuntu用户。

到目前为止,我已经看到了3个其他修复:

在.metadata/, rm .lock文件中 如果#1不起作用,尝试杀死进程javaw.exe等,然后rm .lock文件 如果#1和#2不工作,尝试rm .log文件在.metadata/,并再次检查.plugin/。 这对我来说一直都很有效:重新定位.metadata/,打开和关闭eclipse,然后覆盖。metadata

解决方案可以归结为清理.metadata文件夹。