我在/usr/local/eclipse 中安装了 eclipse。以便我的Mac的其他用户可以访问相同的内容。但是,当我尝试从其他用户登录启动时,出现以下错误:
Locking is not possible in the directory "/usr/local/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.
/usr/local/eclipse/configuration/org.eclipse.osgi/.manager/.fileTableLock (Permission denied
为了解决这个问题,我在~/.bash_profile中添加了以下行
alias eclipse='eclipse -configuration ~/eclipse'
参考:http://computer-help-tips.blogspot.in/2011/05/users-encountering-invalid.html
当我尝试从命令行启动 eclipse 时,它工作正常,但是当我从 Dock 启动它时,会出现相同的警报。这个问题的解决方案是什么?
您需要确保为要使用的 eclipse 的所有用户正确设置锁定文件的权限。如果我没记错的话,几个插件中有锁定文件。也许值得使用 find 来识别它们:
find . -name .fileTableLock -exec ls -las {} ;
还提到了使用"-Dosgi.locking=none",表示您可以关闭锁定的需要,但这对我不起作用。我最终更改了权限...
更新以下编辑:
找到每个文件后,您将使用chmod
更改相应组中用户的权限 - 即将这些 eclipse 锁定文件放入具有组权限的"eclipse"组(man 或 google groupadd
和 chgrp
rw
并将您的用户也添加到该"eclipse"组中(man groups
, usermod -G
)。例如:
$ groupadd eclipse # Create new "eclipse" group
$ chgrp eclipse .fileTableLock # Put .fileTableLock in group eclipse
$ usermodd -a -G eclipse userx # Add userx to eclipse group
$ chmod g+rw .fileTableLock # Ensure .fileTableLock read-write for eclipse group