118

In intelliJ ulimate, running a bare bone spring mvc application I get the error:

'cannot run program '/path/to/tomcat/bin/catalina.sh' error=13 permission denied

How to I fix this? (i'm on a mac)

Blankman
  • 259,732
  • 324
  • 769
  • 1,199
  • path/to/tomcat sounds like there is no tomcat instance installed/assigned in your eclipse – Redlab Jun 22 '10 at 10:07
  • This is a problem at the OS level and so is bordering on being more appropriate for Super User. While it *occurred* during development it's not strictly development-related. – Andrzej Doyle Jun 22 '10 at 12:06
  • @myself i ment intelliJ not eclipse of course – Redlab Jun 22 '10 at 12:23
  • Redlab, path/to'tomcat is just a placeholder that I put, I have it installed. – Blankman Jun 22 '10 at 15:23
  • Complementing the answer... If you prefer grant the execute permission only to the user (instead of granting to everybody). It also works. chmod u+x /path/to/tomcat/bin/catalina.sh – Andrei Apr 15 '20 at 23:48

4 Answers4

277

In short, from a console:

chmod a+x /path/to/tomcat/bin/catalina.sh

This assumes that you 've elided the Tomcat path in your post, and checked that it really does exist on your system before posting here. Depending on the existing permissions of the file, you may need to issue the above command as a user with sufficiently elevated privileges.

Andrzej Doyle
  • 102,507
  • 33
  • 189
  • 228
28

Solution: You set permission for Tomcat directory:

chmod -R 777 apache-tomcat-directory
Vy Do
  • 46,709
  • 59
  • 215
  • 313
  • 2
    After few years, I know that... Indeed, we only need set `*.bat` (on Windows operating system), or `*.sh` (on macOS, Linux operating system) more attribute `executable` is good enough. – Vy Do Feb 08 '19 at 07:22
18

I meet this error today. It's because I take a wrong package of Tomcat6. In Max OS, I should download the tar.gz , but I download the zip. Make sure you get the right Tomcat package.

ZongBing Tian
  • 191
  • 1
  • 2
  • I also downloaded zip and there is no executable permission on any of the files. Downloading tar.gz showed proper executable permission on files. This is the best answer because it sets the proper file permission for all Tomcat files on Mac (not just catalina.sh). Otherwise, you have to manually `chmod +x` each file you want to make executable for user/group/world. – kimbaudi Dec 25 '16 at 14:31
  • Thank you. it helped me – Ilya Y Jan 28 '22 at 20:27
  • Helped me get unstuck as well! – Andy J. Feb 27 '23 at 22:59
12

When I face with this problem I check:
enter image description here

Right click on catalina.sh -> Properties -> Permissions.

DmitMedv
  • 980
  • 3
  • 11
  • 22
  • where to callout this panel? – aircraft Feb 13 '17 at 08:18
  • @DmitMedv This user dialog is not accessible by right clicking the file from finder. How are you getting to this screen? – Tim Schimandle Sep 27 '17 at 17:17
  • Thank you, that did the trick on Kubuntu (I am sure that it will work on any linux distro), but I wonder is necessary on Intellij since that is not necessary on Eclipse – Inmer Aug 25 '18 at 00:43