Windows 7 - Eclipse 现在需要我以管理员身份运行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20442468/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 21:22:49  来源:igfitidea点击:

Windows 7 - Eclipse now needs me to run as administrator

eclipsewindows-7uac

提问by mike rodent

I installed Eclipse (Kepler) on this W7 64-bit machine and initially I could run it "normally" by just clicking the desktop icon or whatever. Then I replaced the whole "workspace" directory with one from another machine (because I'm changing systems).

我在这台 W7 64 位机器上安装了 Eclipse (Kepler),最初我只需单击桌面图标或其他任何东西就可以“正常”运行它。然后我用另一台机器上的目录替换了整个“工作区”目录(因为我正在更改系统)。

Now if I run Eclipse not "as administrator" it opens and will even run apps... but nothing can be saved, including changes to files and updates to the .metadata of any kind.

现在,如果我不是“以管理员身份”运行 Eclipse,它会打开,甚至会运行应用程序……但无法保存任何内容,包括对文件的更改和对任何类型的 .metadata 的更新。

I changed all the "ownership" and "permissions" which could possibly be involved. I am the only user of this machine, and I am in the administrators group. I CANstill use it, if I run "as an administrator". But I'm stumped why the UAC should have been happy to run Eclipse before without the "as 'strator" but now refuses...

我更改了可能涉及的所有“所有权”和“权限”。我是这台机器的唯一用户,我在管理员组。我CAN仍然使用它,如果我运行“作为管理员”。但是我很困惑为什么 UAC 之前应该很乐意在没有“作为 'strator”的情况下运行 Eclipse,但现在拒绝了......

Because... what I've understood about this question is that the UAC looks at apps and decides whether or not they look dodgy and on that basis decides whether you have to run "as 'strator". So what's changed?

因为...我对这个问题的理解是,UAC 会查看应用程序并决定它们是否看起来很狡猾,并在此基础上决定您是否必须“作为“strator”运行。那么有什么变化呢?

I have the option of uninstalling Eclipse and reinstalling it, and then incrementally adding the various project folders... fine, it maywork. But I like to understand these things as far as is feasibly possible!

我可以选择卸载 Eclipse 并重新安装它,然后逐步添加各种项目文件夹......很好,它可能会起作用。但我喜欢尽可能地了解这些事情!

回答by Ian Boyd

Because... what I've understood about this question is that the UAC looks at apps and decides whether or not they look dodgy and on that basis decides whether you have to run "as 'strator".

因为...我对这个问题的理解是,UAC 会查看应用程序并决定它们是否看起来很狡猾,并在此基础上决定您是否必须“作为“strator”运行。

UAC doesn't do anything like that. UAC is an ability of Windows to run an application as an administrator. There are three four ways an application can be run as an administrator (causing the UAC consent dialog to appear):

UAC 不会做类似的事情。UAC 是 Windows 以管理员身份运行应用程序的一种能力。可以通过三种方式以管理员身份运行应用程序(导致出现 UAC 同意对话框):

  • you right-click the application and select "Run As Administrator"
  • the application has been manifested with a requestedExecutionLevelof requireAdministrator
  • the application has a filename that looks like a setup application (e.g. setup.exe, install.exe, update.exe), in which case the Shell opts to run it elevated just in case
  • you call ShellExecutewith the runasverb.
  • 您右键单击该应用程序并选择“以管理员身份运行”
  • 该申请已显现了requestedExecutionLevelrequireAdministrator
  • 该应用程序的文件名看起来像一个安装应用程序(例如setup.exe, install.exe, update.exe),在这种情况下,Shell 选择运行它,以防万一
  • ShellExecuterunas动词打电话。

i think there's one of two things happening:

我认为发生了两件事之一:

  • you missed a spot, in which case you should use Process Monitor to look for Access deniederrors
  • you tried copying files to a protected location (e.g. Program Files) and they were instead redirected to:

    C:\Users\Mike\AppData\Local\VirtualStore\Program Files(x86)\Eclipse
    
  • 你错过了一个地方,在这种情况下你应该使用 Process Monitor 来查找Access denied错误
  • 您尝试将文件复制到受保护的位置(例如程序文件),但它们被重定向到:

    C:\Users\Mike\AppData\Local\VirtualStore\Program Files(x86)\Eclipse
    

And then when you run Eclipse, the files are not there.

然后当您运行 Eclipse 时,文件不存在。

Again, use Process Monitor to find where Eclipse is looking for what.

同样,使用 Process Monitor 来查找 Eclipse 正在寻找什么。