Answers: <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>
  
Answers: CC BY-SA 4.0
Answers: 2020-04-06T03:57:06.803Z
Answers: 2020-04-06T03:57:06.803Z
Answers: A. Man
Body: <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>
  
Comments: CC BY-SA 4.0
Comments: 2020-04-05T23:35:17.190Z
Comments: 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
Comments: Niklas Rosencrantz
Tags: <jenkins>
Title: JAVA home give me wrong value on Jenkins node
UserDisplayName: A. Man
ThreadText: # 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.
  
  
  ---
  
  