如何在 Mac 中的帐户之间共享 Eclipse 工作区?
我基本上想创建一个 Eclipse 工作区,可以在我的 Mac 上的帐户之间进行访问。我目前运行的是 Mac OS X v10.7.1。 另一个需要注意的是,我希望能够在该工作区上使用 Git,这样我就可以从两个帐户中推送和拉取。如果这不可能,我可以切换帐户来执行 Git 操作。
是否可以创建一个可在 Mac OS X Lion 中的 2 个帐户之间访问的 Eclipse 工作区?两个帐户都需要管理员吗?如果这实际上是可能的,我将如何进行设置?
这里有一些关于我的帐户的更多信息(我想都是管理员帐户?)...
$ id HristoOskov
uid=501(HristoOskov) gid=20(staff) groups=20(staff),403(com.apple.sharepoint.group.2),404(com.apple.sharepoint.group.3),402(com.apple.sharepoint.group.1),401(com.apple.access_screensharing),12(everyone),33(_appstore),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),100(_lpoperator),204(_developer)
$ id dev
uid=502(dev) gid=20(staff) groups=20(staff),403(com.apple.sharepoint.group.2),404(com.apple.sharepoint.group.3),402(com.apple.sharepoint.group.1),502(access_bpf),401(com.apple.access_screensharing),12(everyone),33(_appstore),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),100(_lpoperator),204(_developer)
...以及我希望 Eclipse 如何将目录用作工作空间...
$ ll
drwxr-xr-x 4 dev staff 136 Sep 16 18:38 .
drwxr-xr-x+ 39 dev staff 1326 Sep 17 03:59 ..
drwxr-xr-x 4 dev admin 136 Sep 17 03:24 myWorkspace
我尝试过...
所以我尝试制作我想将工作区放入 root
拥有的目录,但是当我尝试创建项目时 Eclipse 会抱怨...
Creation Problems
Parent of resource: /Users/HristoOskov/Sites/random is marked as read-only.
然后我意识到在尝试之前我没有正确清除该目录创建一个工作区。现在,我已完全清除目标目录,并尝试再次创建工作区,但遇到此错误...
I basically want to create an Eclipse workspace that can be accessed between accounts on my Mac. I'm currently running Mac OS X v10.7.1. The other caveat is that I want to be able to do use Git on that workspace so I can push and pull from both accounts. If this is not possible, I'm ok with switching accounts to do the Git stuff.
Is it possible to create an Eclipse workspace that can be accessed between 2 accounts in Mac OS X Lion? Do both accounts need to be admin or not? If this is actually possible, how would I go about setting this up?
Here's some more info about my accounts (both admin, I think?)...
$ id HristoOskov
uid=501(HristoOskov) gid=20(staff) groups=20(staff),403(com.apple.sharepoint.group.2),404(com.apple.sharepoint.group.3),402(com.apple.sharepoint.group.1),401(com.apple.access_screensharing),12(everyone),33(_appstore),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),100(_lpoperator),204(_developer)
$ id dev
uid=502(dev) gid=20(staff) groups=20(staff),403(com.apple.sharepoint.group.2),404(com.apple.sharepoint.group.3),402(com.apple.sharepoint.group.1),502(access_bpf),401(com.apple.access_screensharing),12(everyone),33(_appstore),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),100(_lpoperator),204(_developer)
... and how the directory that I want to have Eclipse use as a workspace...
$ ll
drwxr-xr-x 4 dev staff 136 Sep 16 18:38 .
drwxr-xr-x+ 39 dev staff 1326 Sep 17 03:59 ..
drwxr-xr-x 4 dev admin 136 Sep 17 03:24 myWorkspace
What I've tried...
So I tried making the directory that I want to put the workspace in owned by root
but then Eclipse complains when I try to create a project...
Creation Problems
Parent of resource: /Users/HristoOskov/Sites/random is marked as read-only.
Then I realized that I didn't clear out the directory properly before trying to create a workspace. Now, I have fully cleared the destination directory and I tried to create a workspace again and am faced with this error...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,应该;但是,如果您在两个帐户中同时打开该项目,则可能会遇到阻塞。尝试将访问权限重置为 777,以确定是权限问题还是阻止问题:
如果您现在可以在两个帐户中添加项目,请确保两个帐户都在管理员组中,然后重置组并管理员权限
如果您无法使用相同的消息添加它,请按照上述方式重置权限,并确保两个帐户都在管理员组中。如果不是这样,请添加两个帐户并重试:
如果在结果中,两个帐户中的任何一个都不在管理员组中,您可以使用上面的命令添加帐户(在本例中为 Account2)
然后重新启动。
Yes it should; however, you might experience a blocking, if you open the project simultaneously in both accounts. Try to reset the access rights to 777 to determine, if it is a rights problem or a blocking problem:
If you are able to add the project in both accounts now, make sure both accounts are in the admin-group and reset the group and rights to admin
If you were not able to add it with the same message, reset the rights as stated above and make sure, that both accounts are in the admin-group. If not so, add both accounts and try again:
If in the result, any of the two accounts is not in the admin-group, you may add the account (in this example Account2) with the command
Then restart above.
将工作区放在
/Users/Shared
中,并确保两个用户都具有对文件(包括 Eclipse 的特殊隐藏目录)的读/写访问权限。Put the workspace in
/Users/Shared
and make sure both users have read/write access to the files (including Eclipse's special hidden directories).想通了!以下是工作空间的权限...
技巧是以 root 身份打开 Eclipse。这是我用来执行此操作的命令...
...这以 root 身份运行 Eclipse 实例,我可以从两个帐户访问工作区!
我什至仍然可以使用 Git,但是,我每次都必须执行
sudo git [command]
...但我对此表示同意。Figured it out! Here are the permissions for the workspace...
The trick is opening Eclipse as root. This is the command I use to do so...
... and this runs an Eclipse instance as root and I can access the workspace from both accounts!
I can even still work with Git, however, I must do
sudo git [command]
every time... but I'm ok with that.