Explore Courses Blog Tutorials Interview Questions
+4 votes
in DevOps and Agile by (50.2k points)

Permission denied error while running a simple job in Jenkins
I was trying to build a simple java program on Jenkins and while doing so I got an error saying:

“Permission denied
Execute shell marked built as a failure”

1 Answer

+2 votes
by (108k points)

The error you got only happens when Jenkins does not have permission as a sudo user on the Linux machine.

This works perfectly fine on windows but in Linux, you need to provide sudo permissions.

To get over the error follow these steps:

Step 1: open terminal

Step 2: $sudo nano /etc/sudousers

Step 3: at the end of the file add the following statements:

  • Save and exit

Step 4: Next is you have to go to your job->configure->build triggers->build periodically on your Jenkins page and add sudo in front of your compile statement

It’ll look like this:

Cd /file_path/

Sudo javac

Java filename

 You can learn more about Jenkins by enrolling for Jenkins Training.

Browse Categories