0

I develop plug-in that works under 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")]

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"

Where should be installed a third party software? Why this directory have permissions by default?

MBaev
  • 353
  • 2
  • 20

2 Answers2

1

There are probably two reasons:

  1. lua5.1.sh is not executable. 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. Maybe in this shell some of operations need root permission. Try to run it by sudo:

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

Bejond
  • 1,188
  • 1
  • 11
  • 18
  • While `sudo` will no doubt run the script, it should not be applied too eagerly. We do not know what the script will do. – Eero Aaltonen May 09 '18 at 08:55
  • But I want to programmatically unarchive the third party software in user home dir and then start the .sh file programmatically without need any permissions, this is possible? – MBaev May 09 '18 at 09:02
  • @MBaev then you need to set the file executable programmatically. https://stackoverflow.com/a/664443/3908814 – Bejond May 09 '18 at 09:17
  • I resolved this problem with permission settings. Thank you @Bejond – MBaev May 09 '18 at 12:11
0

This might also belong to 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. 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.

Eero Aaltonen
  • 4,239
  • 1
  • 29
  • 41