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

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

但我知道它不是。

我如何“解锁”它?


当前回答

在管理员模式下运行eclipse为我解决了这个问题。您可以通过[右键单击]->在安装目录下以管理员身份运行eclipse.exe。

我在win7机器的工作环境中具有限制性权限。我还删除了.lock和.log文件,但这并没有帮助。它也可以是所有这些因素的结合。

其他回答

@Boris给出的答案在99%的情况下是正确的,但是如果您在旧版本的Eclipse中打开工作区,也可能发生这种情况。用Juno导入/创建的工作区在Galileo中打开时将抛出此错误。

在我的例子中,在工作区的位置C:\之前有一个空格。我删除了那个空间,这就足够了:)

如果有人有STM32Cube相关的问题,这显然是基于Eclipse的,有同样的问题,以上的建议对我都不适用,这里是我如何修复它,对于Linux,尽管我想你也可以在Windows中找到相应的路径。

在$HOME目录下,进入.eclipse/com.st.stm32cube.ide…/configuration/settings

prefs文件包含很少的选项,包括最近的工作空间路径,以及它是否会提示您在启动时选择一个工作空间。修改RECENT_WORKSPACES的路径,或者启用SHOW_WORKSPACE_SELECTION_DIALOG。

选择一个“不同的”实际上是一个相当简单的解决方案。

我一直以管理员身份运行Eclipse(从命令行执行sudo Eclipse),因为“workspace”文件夹正在抛出工作区,或者无法创建…错误(以管理员身份运行似乎是修复该问题的唯一解决方案)。

一位同事(与我一起处理相同的问题)希望通过单击图标来运行Eclipse。所以当他运行Eclipse时,对话框出现了“选择您的工作区”,他只是在“工作区”后面加了一个“2”。

这将创建一个新文件夹:"workspace2"。《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.