How to setup the Environment Variable PATH in Jenkins?

I downloaded and installed the Gradle 2.7 on a Red Hat server. I also installed the Gradle plugin 1.24 on a Jenkins 1.602 server. I can run the plugin, but not as shell script. The issue is gradle is not in the PATH. The jekins’s PATH is /sbin:/usr/sbin:/bin:/usr/bin. I can’t seem to find a way to add the gradle path to the PATH environment variable. Any idea?

thanks

java_guy

Instead of installing the Gradle runtime on Jenkins, it’s much easier (and also recommended practice) to use the Gradle Wrapper instead. With that you don’t need to have Gradle in the PATH anymore.

1 Like

Hi Benjamin,

Thank you for your tips. However, there is security/internet connection restriction on the build/jenkins server that I can’t use wrapper to load libraries from the net.

thanks

java_guy

Using the wrapper doesn’t require that the Gradle distribution come from the Internet. We have a similar restriction on Internet connections from the build server, but have the Gradle distribution available locally. Can you not do that?

Hi James,

Thank you for you tips. I didn’t know I can change the distributionUrl to a local copy.

thanks.

java_guy