How To Set The Java Path In Mac For Jenkins



  • Status:Closed(View Workflow)
  • Resolution: Cannot Reproduce
  • Labels:

PATH env variable is set wrong on slave: Jenkins 1.533 + Jenkins SSH Slaves plugin 1.5.
But on Jenkins 1.528 + SSH Slaves 1.2, it was correct.

On Node Configuration
name= PATH
value= $PATH:$ANDROID_NDK_HOME:$ANDROID_SDK_HOME/tools:$ANDROID_SDK_HOME/platform-tools:$JAVA_HOME/bin/:.

Jenkins Set Environment Variables When a Jenkins job executes, it sets some environment variables that you may use in your shell script, batch command, Ant script or Maven POM 1. The following table contains a list of all of these environment variables. We are assuming Java 1.7.0.60 as installed version for this tutorial. Step 2 - Set JAVA Environment. Set the JAVAHOME environment variable to point to the base directory location where Java is installed on your machine. From the home page, click on the link Manage Jenkins and click on Configure System as shown below: From the next page, click on 'Add JDK'. The easiest way to configure JDK is to provide a name and path of the java installation directory. (Consider the same path used for JAVAHOME). If we want to run java.exe or similar executables provided by JRE or JDK we have to add the path of Java in the Path variable like below. We select the system variable named Path and click to the Edit. Set JAVA Executable Path Here we click to New which will add a new line to the existing values.

On a simple job to test $PATH
echo $PATH

+ echo $PATH:$ANDROID_NDK_HOME:$ANDROID_SDK_HOME/tools:$ANDROID_SDK_HOME/platform-tools:$JAVA_HOME/bin/:.:/usr/lib/android-ndk:/usr/lib/android-sdk/tools:/usr/lib/android-sdk/platform-tools:/usr/lib/jvm/java-6-oracle/bin/:.:/usr/lib/android-ndk:/usr/lib/android-sdk/tools:/usr/lib/android-sdk/platform-tools:/usr/lib/jvm/java-6-oracle/bin/:.:/usr/lib/android-ndk:/usr/lib/android-sdk/tools:/usr/lib/android-sdk/platform-tools:/usr/lib/jvm/java-6-oracle/bin/:.
$PATH:$ANDROID_NDK_HOME:$ANDROID_SDK_HOME/tools:$ANDROID_SDK_HOME/platform-tools:$JAVA_HOME/bin/:.:/usr/lib/android-ndk:/usr/lib/android-sdk/tools:/usr/lib/android-sdk/platform-tools:/usr/lib/jvm/java-6-oracle/bin/:.:/usr/lib/android-ndk:/usr/lib/android-sdk/tools:/usr/lib/android-sdk/platform-tools:/usr/lib/jvm/java-6-oracle/bin/:.:/usr/lib/android-ndk:/usr/lib/android-sdk/tools:/usr/lib/android-sdk/platform-tools:/usr/lib/jvm/java-6-oracle/bin/:.

How To Set The Java Path In Mac For Jenkins Youtube

But, On Jenkins 1.528 + SSH Slaves 1.2

Path

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/android-ndk:/usr/lib/android-sdk/tools:/usr/lib/android-sdk/platform-tools:/usr/lib/jvm/java-6-oracle/bin/:.:/usr/lib/android-ndk:/usr/lib/android-sdk/tools:/usr/lib/android-sdk/platform-tools:/usr/lib/jvm/java-6-oracle/bin/:.

Hide
hyunil shin added a comment -

I found something.
I read carefully the description page of SSH slaves plugin.

As EnvInject plugin is installed and 'Prepare jobs environments' options is enabled on that node, PATH is set correctly.

Show
hyunil shin added a comment - I found something. I read carefully the description page of SSH slaves plugin. As EnvInject plugin is installed and 'Prepare jobs environments' options is enabled on that node, PATH is set correctly.
Assignee:
Ivan Fernandez Calvo
Reporter:
hyunil shin

How To Set The Java Path In Mac For Jenkins Free

Votes:
0Vote for this issue
Watchers:
1Start watching this issue