在目录 C:\eclipse\configuration\org.eclipse.osgi 中无法锁定
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8214957/
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
Locking is not possible in the directory C:\eclipse\configuration\org.eclipse.osgi
提问by ateiob
I used to have Eclipse 3.5.2 working from my Limited User Account (i.e. not Administrator).
我曾经使用我的受限用户帐户(即不是管理员)使用 Eclipse 3.5.2。
But when I upgraded to 3.6.2, Eclipse refuses to run in the Limited User Account (it only runs under administrator).
但是当我升级到 3.6.2 时,Eclipse 拒绝在受限用户帐户中运行(它只能在管理员下运行)。
It issues the following error:
它发出以下错误:
Locking is not possible in the directory C:\eclipse\configuration\org.eclipse.osgi. A common reason is that the file system or Runtime Environment does not support file locking for that location. Please choose a different location, or disable file locking passing "-Dosgi.locking=none" as a VM argument. C:\eclipse\configuration\org.eclipse.osgi.manager.fileTableLock (Access is denied)
在目录 C:\eclipse\configuration\org.eclipse.osgi 中无法锁定。一个常见的原因是文件系统或运行时环境不支持该位置的文件锁定。请选择不同的位置,或禁用文件锁定传递“-Dosgi.locking=none”作为 VM 参数。C:\eclipse\configuration\org.eclipse.osgi.manager.fileTableLock(访问被拒绝)
Well, I checked the owner of that folder (Windows XP) and it is the Administrator, so of course access would be denied.
好吧,我检查了该文件夹的所有者 (Windows XP),它是管理员,所以访问当然会被拒绝。
But... why didn't this happen in Eclipse 3.5.2?
但是……为什么这在 Eclipse 3.5.2 中没有发生?
I could probably workaround this by assigning ownership of the entire C:\eclipse\configuration\org.eclipse.osgi
but without understanding why, I don't know whether I would need to do that for additional folders.
我可能可以通过分配整个C:\eclipse\configuration\org.eclipse.osgi
文件夹的所有权来解决这个问题,但不明白为什么,我不知道我是否需要为其他文件夹这样做。
Another workaround is to do just as the error message suggests: Disable file locking passing -Dosgi.locking=none
as a VM argument. But I don't what the tradeoff would be (locking is there for a reason, right? What is it?)
另一种解决方法是按照错误消息的建议进行操作:禁用-Dosgi.locking=none
作为 VM 参数传递的文件锁定。但我不知道权衡是什么(锁定是有原因的,对吧?它是什么?)
If I understand what the purpose of that locking is, I can wisely choose one of the 2 workarounds outlined above.
如果我了解锁定的目的是什么,我可以明智地选择上述两种解决方法之一。
采纳答案by Fredrik
This has to do with running Eclipse in a multi-user environment, first read this Eclipse help sectionon multi user installations. When Eclipse was installed, it was done so as an admin account. This meant that the configuration
folder was accessible and Eclipse thought this was a shared configuration or private install. Because of this Eclipse will first try to write data to the configuration catalog, but will fail for normal users.
这与在多用户环境中运行 Eclipse 有关,首先阅读有关多用户安装的Eclipse 帮助部分。安装 Eclipse 时,它是作为管理员帐户完成的。这意味着该configuration
文件夹是可访问的,Eclipse 认为这是共享配置或私有安装。因此 Eclipse 会首先尝试将数据写入配置目录,但对于普通用户来说将失败。
What you want to do is to make Eclipse realize that you have a shared install installation and that all configuration data should be in the users home directory.
您想要做的是让 Eclipse 意识到您有一个共享安装安装,并且所有配置数据都应该在用户主目录中。
See this similar questionand this IBM support answerfor more information.
有关更多信息,请参阅此类似问题和此 IBM 支持答案。
回答by Marco Alvarado
I had the same problem with the Juno version.
我在 Juno 版本中遇到了同样的问题。
Several years ago I made a multiuser environment that worked perfectly, but the things changed with time. Now, my obvious solution, to change permissions, didn't work at all.
几年前,我制作了一个完美运行的多用户环境,但随着时间的推移,情况发生了变化。现在,我更改权限的明显解决方案根本不起作用。
The issue is that the lock files have special permissions that the 777
won't change. Also, it is not the best solution just to provide the 777
to a directory inside any UNIX system (Linux, AIX, etc.); then, I worked around to another solution.
问题是锁定文件具有777
不会更改的特殊权限。此外,仅向777
任何 UNIX 系统(Linux、AIX 等)内的目录提供目录并不是最好的解决方案;然后,我解决了另一个解决方案。
Inside the Eclipse directory you can find a eclipse.ini
file. There you can put the vm arguments, although the one suggested by Eclipse won't work.
在 Eclipse 目录中,您可以找到一个eclipse.ini
文件。您可以在那里放置 vm 参数,尽管 Eclipse 建议的参数不起作用。
My environment started working with this one:
我的环境开始使用这个:
[email protected]/.eclipse
This way, each user inside the environment that run the Eclipse program, will create a different .eclipse
directory inside the particular home, with full rights and zero problems.
这样,运行 Eclipse 程序的环境中的每个用户将.eclipse
在特定的 home 中创建一个不同的目录,具有完全的权限和零问题。
I expect this to be useful for everyone "in the UNIX side".
我希望这对“在 UNIX 方面”的每个人都有用。
回答by saada
Proper fix
正确修复
Make sure you update the permissions of Eclipse and the workspace to whatever user Eclipse runs as. You can use ps -ef | grep -i eclipse
while eclipse is running to find that user.
Once you have the user, you can easily use chown -R user:group ~/Documents/workspace**
确保将 Eclipse 和工作区的权限更新为 Eclipse 运行的任何用户。您可以ps -ef | grep -i eclipse
在 eclipse 运行时使用来查找该用户。一旦有了用户,就可以轻松使用chown -R user:group ~/Documents/workspace**
Hacky fix
黑客修复
Change permission of eclipse itself wherever you have it installed (in my case /opt/):
sudo chmod -R 770 /opt/eclipse
Change permission of workspace wherever you have it located (in my case ~/Documents/):
sudo chmod -R 770 ~/Documents/workspace
在安装了 eclipse 的任何地方更改其权限(在我的情况下为 /opt/):
须藤 chmod -R 770 /opt/eclipse
无论您在何处都更改工作区的权限(在我的情况下为 ~/Documents/):
须藤 chmod -R 770 ~/文件/工作区
Hope this helps my fellow Linux users!
希望这对我的 Linux 用户有所帮助!
You can try this on windows with the proper syntax.
您可以使用正确的语法在 Windows 上尝试此操作。
Thanks to Frederik for your help!
感谢弗雷德里克的帮助!
回答by Alexandre Polozoff
I wouldn't chmod
to 777 to fix this problem. In my case the owner was root:root
after a Rational Team Concert install for some RTC files and not my userid. Go to your user's home directory and ls -ltr
to see what your userid and groupid are (on Ubuntu mine were both the same) and then execute the following on your eclipse subdirectory
我不会chmod
用 777 来解决这个问题。在我的情况下,所有者是root:root
在为某些 RTC 文件而不是我的用户 ID 安装 Rational Team Concert 之后。转到您用户的主目录并ls -ltr
查看您的 userid 和 groupid 是什么(在 Ubuntu 上我的都是相同的),然后在您的 eclipse 子目录中执行以下命令
sudo chown -R myuserid:groupid /opt/ibm/eclipse
回答by ems
I had this problem when trying to create a workspace in a mapped network drive.
尝试在映射的网络驱动器中创建工作区时遇到了这个问题。
One option is to start Eclipse from terminal with ./eclipse -vmargs -Dosgi.locking=none
.
一种选择是从终端使用./eclipse -vmargs -Dosgi.locking=none
.
Another option is to add osgi.locking=none
to the config.ini file in Eclilpse's configuration folder.
另一种选择是添加osgi.locking=none
到 Eclilpse 配置文件夹中的 config.ini 文件。
The second option is more convenient, but has the side effect of allowing any number of Eclipse instances running the same workspace.
第二个选项更方便,但有一个副作用,即允许任意数量的 Eclipse 实例运行相同的工作空间。
回答by Sikander
I simply added osgi.locking=none in the config.ini file, it started working. Thank you all for your help..
我只是在 config.ini 文件中添加了 osgi.locking=none ,它开始工作了。谢谢大家的帮助..
回答by Matthew Wise
Here is another reason why this message appears. It may seem an obvious thing to check, but if the read-only flag is set on the .fileTableLock
file (this is in Windows, don't know about Linux) then you'll also get that Access Denied error. This arose because we were unzipping a pre-configured workspace and configuration into our users' IDE environments.
这是出现此消息的另一个原因。检查似乎是一件显而易见的事情,但是如果在.fileTableLock
文件上设置了只读标志(这是在 Windows 中,不知道 Linux),那么您也会收到拒绝访问错误。出现这种情况是因为我们将预配置的工作区和配置解压缩到用户的 IDE 环境中。
回答by Umesh Patil
Well on windows, a simple work around for the same is to start Eclipse as an Administrator.
在 Windows 上,一个简单的解决方法是以管理员身份启动 Eclipse。
Right Click on Eclipse icon and click on Run as administrator.
右键单击 Eclipse 图标,然后单击以管理员身份运行。
It will solve your problem.
它会解决你的问题。
Enjoy :)
享受 :)
回答by James Blackburn
Who has write access to the directory: C:\eclipse & C:\eclipse\configuration ?
谁对目录有写访问权限: C:\eclipse & C:\eclipse\configuration ?
AFAIK eclipse decides, on startup, whether to use the central installation as the configuration location, or a user accessible directory based on whether the eclipse (or possibly the configuration) directory are writable.
AFAIK eclipse 在启动时根据 eclipse(或可能的配置)目录是否可写来决定是使用中央安装作为配置位置,还是使用用户可访问的目录。
回答by rahil008
simply copy and paste your eclipse folder to a folder in your currently logged in user space (in case you are having hard time finding one of the correct folders, just put it in C:\Documents and Settings\your_user_account_name) .And create a new workspace folder there only. Worked for me....!
只需将您的 eclipse 文件夹复制并粘贴到您当前登录的用户空间中的文件夹中(如果您很难找到正确的文件夹之一,只需将其放在 C:\Documents and Settings\your_user_account_name 中)。并创建一个新的工作区文件夹只有那里。对我来说有效......!