title: Change JAVA_HOME in docker
body: <p>The legacy web application which I want to dockerise uses some old classes like <code>com/sun/image/codec/jpeg/ImageFormatException</code> which were supported till Java SE7. 
  Now in the docker container default jdk getting (on installing tomcat-6 container) is </p>
  
  <pre><code>java version "1.7.0_131"
  OpenJDK Runtime Environment (IcedTea 2.6.9) (7u131-2.6.9-2~deb8u1)
  </code></pre>
  
  <p>OpenJdk doesn't support these classes</p>
  
  <p>I used <code>update-alternatives</code> to install Oracle Jdk7.80</p>
  
  <p>After loading container, on giving <code>java -version</code> I am getting </p>
  
  <pre><code>java version "1.7.0_80"
  Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
  Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
  </code></pre>
  
  <p>However, <code>echo $JAVA_HOME</code> after entering the container gives <code>/docker-java-home/jre</code> which again points to OpenJdk. How can I set <code>JAVA_HOME</code> to the Oracle Jdk home that I installed?</p>