<p>Got response from SO forum: Is there a <code>JAVA_HOME</code> configured under <code>Mange Jenkins -&gt; Global Tool Configuration -&gt; JDK</code>? You may have to click on <code>JDK installations</code> to be able to see what's configured there.</p>

CC BY-SA 4.0
2020-04-06T03:57:06.803Z
2020-04-06T03:57:06.803Z
A. Man
<p>I have Jenkins node with below configuration for JavaPath:</p>

<pre><code>/usr/java/jdk1.8.0_131/bin/java
</code></pre>

<p>I wrote a simple Jenkins job which does the following:</p>

<pre><code>#!/bin/ksh
echo "JAVA_HOME=${JAVA_HOME}"
echo $PATH
</code></pre>

<p>for some reason, the output I'm getting is:</p>

<pre><code>JAVA_HOME=/usr/java/jdk1.8.0_31
</code></pre>

<p>why it doesn't use the value which used to load node?</p>

CC BY-SA 4.0
2020-04-05T23:35:17.190Z
Looks like `JAVA_HOME` is the path to the Java installation while the "JavaPath" is the path to the binary executable named `java` (?) ... Are you sure that the variable should be named "JavaPath" to get picked up and propagate as an environment variable? How is it a "real problem" for you, any stacktrace for some actual task or are you just needing to know? Did you read this https://stackoverflow.com/questions/8185593/jenkins-specifying-java-home
Niklas Rosencrantz
<jenkins>
JAVA home give me wrong value on Jenkins node
A. Man
# JAVA home give me wrong value on Jenkins node

(Asked by: username_0 on 2020-04-02)

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?

**Tags:** jenkins

> **Comments:**
> **username_1**: Looks like `JAVA_HOME` is the path to the Java installation while the "JavaPath" is the path to the binary executable named `java` (?) ... Are you sure that the variable should be named "JavaPath" to get picked up and propagate as an environment variable? How is it a "real problem" for you, any stacktrace for some actual task or are you just needing to know? Did you read this https://stackoverflow.com/questions/8185593/jenkins-specifying-java-home  

---

## 1 answers

### Answer by username_0 on 2020-04-06. Score: 1 | Accepted answer

Got response from SO forum: Is there a `JAVA_HOME` configured under `Mange Jenkins -> Global Tool Configuration -> JDK`? You may have to click on `JDK installations` to be able to see what's configured there.


---

