开发者

opening jar file with admin privilege

I am getting this exception when i open jar file using cmd: java.io.FileNotFoundException: C:\Windows\System32\drivers\etc\hosts.File (Access is denied) How can i open jar file with administrator privilege开发者_如何学Python? Simply double clicking the jar file does not open the jar file.I am using win7 as OS.


If I understand correctly, you're trying to run java from a command prompt but want admin privileges. In that case, right-click on the "command prompt" and choose "run as administrator", then you can

java -jar myprogram.jar

from the command prompt as before.

However do you really want to allow this program to edit your hosts file? I'd recommend you find out what it's trying to do and make the change manually if you're happy with it.


If you want to run jar file with admin privileges from console or by double clicking, without explicitly executing it with admin rights Which is most obvious from user's point of view as he might just know how to click and not internal working. Then this is my post answering your quest in simple steps. Run Java file as Administrator with full privileges

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜