title: Installing maven in a docker build overrides JAVA 8 with JAVA 7(!)
body: <p>It appears that maven overrides Java 8 with Java 7.  Consider the following Dockerfile:</p>
  
  <pre><code>FROM java:8
  RUN java -version &amp;&amp; ls -l /usr/bin/java    
  RUN apt-get update -y &amp;&amp; apt-get install maven -y
  RUN java -version &amp;&amp; ls -l /usr/bin/java    
  </code></pre>
  
  <p>Line two will report the java version is 1.8 <strong>but line 4 will report java version is 1.7.</strong>  In both cases the <code>/usr/bin/java</code> symlink points to <code>/etc/alternatives/java</code> </p>
  
  <p>Besides re-installing Java 8 (which is why I started with Java:8 in the first place), how can I undo these side-effects of installing maven when building a docker image?</p>