title: Target different version of JRE
body: <p>I'm testing Java on a Windows Surface Pro. The Surface Pro has Java 7 Update 55, but <em>does not</em> have the JDK installed.</p>
  
  <p>I compiled a program on my MacBook from the command line using <code>javac</code>. The MacBook Has Java 8 Update 5 and it includes the JDK (obviously because I compiled on the MBP).</p>
  
  <p>When I move the program from the MackBook to the Surface Pro, I get the following error. Here, "moving the program" means copying the two <code>*.class</code> files to the new machine and trying to execute the byte codes.</p>
  
  <pre><code>java.lang.UnsupportedClassVersionError: HttpsTest : Unsupported major.minor version 52.
  </code></pre>
  
  <p>Trying to compile with target information results in:</p>
  
  <pre><code>$ javac -target 1.7 HttpsTest.java SSLSocketFactoryEx.java
  javac: target release 1.7 conflicts with default source release 1.8
  </code></pre>
  
  <p><code>javac -help</code> does not list any options to control the version information of the compiled program (other than <code>target</code>, which does not appear to work).</p>
  
  <p>How do I compile my source files for down level versions of a JRE? In this case, I'm targeting Java 7 from a Java 8 machine.</p>