[英]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: 可能有两个原因:
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
error=13, Permission denied
. error=13, Permission denied
。 Maybe in this shell some of operations need root permission. 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.