title: JAVA_HOME not found as Sudo
body: <p>I have a bash script on a Linux box that runs a Jar file. When logged in as a regular user I don't have permission to run the script, but it prints the following log:</p>
  
  <pre><code>*INFO * Using JVM found at /opt/jdk6/bin/java
  </code></pre>
  
  <p>When I try to use the script with Sudo though, it gives:</p>
  
  <pre><code>*ERROR* Unable to locate java, please make sure java is installed and JAVA_HOME set
  </code></pre>
  
  <p>I've set <code>JAVA_HOME</code> to the same path above — can see it with <code>echo $JAVA_HOME</code> &amp; it's also set as an option within the script. I'm happy that the script isn't the issue — it's a default CQ5 control script &amp; I'm using it on dozens of other boxes without issue. Just unsure what I'm doing wrong above &amp; presume it's something I'm missing re Linux set-up?</p>
  
  <p>When I run the <code>sudo</code> command, does it have access to the <code>JAVA_HOME</code> that I set up as myself?</p>