java 运行可执行 jar 文件的最低 Unix 权限是多少?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2668796/
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
What are the minimum unix permissions to run an executable jar file?
提问by chotchki
If I have a jar that I need to run using java -jar FOO.jaron unix, does this depend on the read, write or execute bit? Or some combination thereof?
如果我有一个需要java -jar FOO.jar在 unix上运行的 jar,这是否取决于读取、写入或执行位?或者它们的某种组合?
回答by Shizzmo
You just need read on the .jar, since 'java' is what you're executing, and it reads the jar.
您只需要阅读 .jar,因为 'java' 是您正在执行的内容,它会读取 jar。
回答by Hyman
You will need read, since the jar is virtually executed by java (of course java needs to have execpermissions). But if you have a program that stores some datas inside itself (it can happen, for example storing settings) I would suggest to have also the writeattribute set.
您将需要read,因为 jar 是由 java 虚拟执行的(当然 java 需要具有exec权限)。但是,如果您有一个程序在其内部存储一些数据(它可能发生,例如存储设置),我建议也设置write属性。

