简体   繁体   English

蚀| 尝试在Ubuntu下打开sh文件时权限被拒绝

[英]Eclipse | Permission denied when trying to open sh file under Ubuntu

I develop plug-in that works under Ubuntu. 我开发了可在Ubuntu下使用的插件。 The plug-in is required to install a third party software with which it works. 需要使用该插件才能安装可与其一起使用的第三方软件。 Installation directory is "user home" [System.getProperty("user.home")] 安装目录为“用户主目录” [System.getProperty(“ user.home”)]

After installation, when I try to open the executable file from this third party software is throwing an exception - 安装后,当我尝试从该第三方软件打开可执行文件时引发异常-

java.io.IOException: Cannot run program >/home/mbaev/Tools/flasher/1.5.0/lua5.1.sh": error=13, Permission denied" java.io.IOException:无法运行程序> /home/mbaev/Tools/flasher/1.5.0/lua5.1.sh“:错误= 13,权限被拒绝”

Where should be installed a third party software? 应该在哪里安装第三方软件? Why this directory have permissions by default? 为什么默认情况下此目录具有权限?

There are probably two reasons: 可能有两个原因:

  1. lua5.1.sh is not executable. lua5.1.sh不可执行。 You can make it executable by setting: 您可以通过设置使其可执行:

sudo chmod +x /home/mbaev/Tools/flasher/1.5.0/lua5.1.sh

And then run it: 然后运行它:

./home/mbaev/Tools/flasher/1.5.0/lua5.1.sh

  1. If lua5.1.sh is executable but still says error=13, Permission denied . 如果lua5.1.sh是可执行文件,但仍然显示error=13, Permission denied Maybe in this shell some of operations need root permission. 也许在此shell中,某些操作需要root权限。 Try to run it by sudo: 尝试通过sudo运行它:

sudo ./home/mbaev/Tools/flasher/1.5.0/lua5.1.sh

This might also belong to Ask Ubuntu . 这也可能属于Ask Ubuntu

Anyway, in order to run a script on linux, you need to have access rights to the directory the script is in, and execute rights set on the script. 无论如何,为了在Linux上运行脚本,您需要具有对该脚本所在目录的访问权限,并需要执行对该脚本设置的权限 Most likely you are missing the exec rights . 您很可能缺少执行者权利

The command 命令

chmod u+x <myscript.sh>

Will add execute rights for the current user. 将为当前用户添加执行权限。 Try that first. 先尝试一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ubuntu 中的 android studio 的 studio.sh 打开权限被拒绝 - studio.sh open permission denied for android studio in ubuntu 尝试写入文件时,Tomcat权限被拒绝 - Tomcat permission denied when trying to write a file 尝试启动应用程序时出现Eclipse“权限被拒绝”错误 - Eclipse “Permission denied” error when trying to launch app 尝试构建工作区时 STS/Eclipse 权限被拒绝错误 - STS/Eclipse permission denied error when trying to build workspace 错误 = 13,通过 eclipse 中的自动化运行 a.sh 文件时权限被拒绝 - error=13, permission denied while running a .sh file through automation in eclipse 打开失败:尝试创建 csv 文件时出现 EACCES(权限被拒绝) - open failed: EACCES (Permission denied) while trying to create csv file 尝试将文件写入Android中的SD卡时,FileNotFoundException(权限被拒绝) - FileNotFoundException (permission denied) when trying to write file to sdcard in Android sh:java:试图执行.jar文件的权限被拒绝 - sh: java: permission denied tryinng to execute .jar file 尝试以编程方式在Eclipse中打开文件时获取类强制转换异常 - Getting class cast exception when trying to open a file in eclipse programatically Android打开失败:尝试读取数据/数据中的文件时EACCES(权限被拒绝) - Android open failed: EACCES (Permission denied) when try to read a file in data/data
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM