JAVA home give me wrong value on Jenkins node I have Jenkins node with below configuration for JavaPath:

/usr/java/jdk1.8.0_131/bin/java


I wrote a simple Jenkins job which does the following:

#!/bin/ksh
echo "JAVA_HOME=${JAVA_HOME}"
echo $PATH


for some reason, the output I'm getting is:

JAVA_HOME=/usr/java/jdk1.8.0_31


why it doesn't use the value which used to load node?
Got response from SO forum: Is there a JAVA_HOME configured under Mange Jenkins -&gt; Global Tool Configuration -&gt; JDK? You may have to click on JDK installations to be able to see what's configured there.