title: JDK environment variable ( Ubuntu 12.04) with tomcat
body: <p>In Ubuntu,i set jdk environment(JAVA_HOME,JRE_HOME), and java -version can use.
  but i can start up tomcat. some info :</p>
  
  <ul>
  <li>Neither the JAVA_HOME nor the JRE_HOME environment variable is defined</li>
  <li>At least one of these environment variable is needed to run this program</li>
  </ul>
  
  <p>environment set <strong>/etc/profile</strong></p>
  
  <pre><code>JAVA_HOME=/opt/jvm/java/jdk1.7.0_25
  JRE_HOME=/opt/jvm/java/jdk1.7.0_25/jre
  PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME
  export JAVA_HOME
  export JRE_HOME
  export PATH
  </code></pre>
  
  <p>logs</p>
  
  <pre><code>sunshanming@sunshanming-vm1:~$ sudo /opt/apache-tomcat-7.0.42/bin/startup.sh 
  [sudo] password for sunshanming: 
  Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
  At least one of these environment variable is needed to run this program
  sunshanming@sunshanming-vm1:~$ echo $JAVA_HOME
  /opt/jvm/java/jdk1.7.0_25
  sunshanming@sunshanming-vm1:~$ echo $JRE_HOME
  /opt/jvm/java/jdk1.7.0_25/jre
  sunshanming@sunshanming-vm1:~$ java -version
  java version "1.7.0_25"
  Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
  Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
  </code></pre>