Problems about Jenkins running remote shell script
<p>I have some question when using jenkins.</p>

<p>the scenario:</p>

<ol>
<li>I have installed a tomcat on machine A,and config all necessary environment including JDK, and they work well.</li>
<li>I wrote a shell script named restart.sh to kill the tomcat process,and restart.
I execute the script and it works well.When I check the tomcat process using ps -ef，and it shows the exact JDK path as I already config.The JDK path is /usr/local/java/JDK7</li>
<li>When I execute the restart.sh script via jenkins,problem comes. I can see the tomcat process using the wrong JDK path,/usr/bin/java,not the path as i config. I use SSH Publishers plugin to run the remote script.see as the image below:
<a href="http://i.stack.imgur.com/urtUD.png" rel="nofollow">enter image description here</a></li>
</ol>

<p>I don't know how this problem happen,please help,Thanks all</p>