Legacy Knowledge Base
Published Jul. 2, 2025

Jenkins builds are failing due to "Cannot run program ./gradlew" error

Written By

Matheus Monteiro

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.
Note: please note that Liferay has renamed its Liferay Experience Could offerings to Liferay SaaS (formerly LXC) and Liferay PaaS (formerly LXC-SM).

Issue

  • Builds on Jenkins are failing due to the following error:
    Cannot run program "./gradlew" (in directory "/var/jenkins_home/workspace/YOUR_REPO_NAME_master"): error=13, Permission denied

Screen_Shot_2020-08-05_at_09.13.18.png

Environment

  • Liferay PaaS
  • Jenkins image 3.2.8 or older

Resolution

  • On your local repository, in the root folder, please check the permissions of the file gradlew by using the command (if you are on Linux or mac):
    ls -la
  • If you confirm that gradlew file does not have execute permissions, go ahead and change its permissions with:
    chmod +x gradlew
  • Commit and build again
  • If the error still occurs (please make sure you are building based on the branch in which you modified the file permissions), please open a support ticket.  
Did this article resolve your issue ?

Legacy Knowledge Base