title: Eclipse/Ant Making a jar in version 1.9, even though everything seems to be set for 1.8
body: <p>I have a project I build using ant and eclipse which I'd like to have be compatible with Java 8. </p>
  
  <p>When I try running the jar using Java 8, I get the following error:</p>
  
  <pre><code>$ /usr/lib/jvm/java-8-openjdk-amd64/bin/java -jar hypnos.jar
  Error: A JNI error has occurred, please check your installation and try again
  Exception in thread "main" java.lang.UnsupportedClassVersionError:
  org/joshuad/musicplayer/MusicPlayerUI has been compiled by a more recent version of
  the Java Runtime (class file version 53.0), this version of the Java Runtime only 
  recognizes class file versions up to 52.0
  </code></pre>
  
  <p>So it appears that it's compiling using Oracle's Java 9 (which is installed on my system) but I can't find the place in eclipse where this is designated. Everything I see seems to suggest that we're using java 8 (screenshots below). </p>
  
  <p>I feel like I must be missing something, but I can't figure out where. <strong>What do I have to do to get this jar to be compatible with Java 8 / class file version 52.0?</strong></p>
  
  <p><strong>Project > Properties > Java Build Path</strong><a href="https://i.stack.imgur.com/VsiJ3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VsiJ3.png" alt="enter image description here"></a></p>
  
  <p><strong>Project > Properties > Java Compiler</strong>
  <a href="https://i.stack.imgur.com/qq6NK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qq6NK.png" alt="enter image description here"></a></p>
  
  <p><strong>Window > Preferences > Compiler</strong>
  <a href="https://i.stack.imgur.com/cClVb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cClVb.png" alt="enter image description here"></a></p>
  
  <p><strong>Right Click Ant Build File > Run As > External Tools Configuration</strong>
  <a href="https://i.stack.imgur.com/5VE1m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5VE1m.png" alt="enter image description here"></a></p>
  
  <p><strong>Ant Build File</strong></p>
  
  <pre><code>&lt;project name="Hypnos Music Player" default="compile" basedir="."&gt;
      &lt;property name="src" location="src"/&gt;
      &lt;property name="build" location="build"/&gt;
      &lt;property name="jarFile" location="hypnos.jar"/&gt;
  
      &lt;path id="class.path"&gt;
          &lt;fileset dir="lib"&gt;
              &lt;include name="**/*.jar" /&gt;
          &lt;/fileset&gt;
          &lt;pathelement location="${jarFile}" /&gt;
      &lt;/path&gt;
  
      &lt;target name="init"&gt;
          &lt;tstamp/&gt;
          &lt;mkdir dir="${build}"/&gt;
      &lt;/target&gt;
  
      &lt;target name="compile" depends="init" description="compile the source"&gt;
          &lt;javac fork="yes" includeantruntime="false" srcdir="${src}" destdir="${build}"&gt;
              &lt;classpath refid="class.path" /&gt;
          &lt;/javac&gt;
      &lt;/target&gt;
  
      &lt;target name="jar" depends="compile" description="Create a jar."&gt;
          &lt;jar destfile="${jarFile}" basedir="${build}"&gt;
              &lt;manifest&gt;
                  &lt;attribute name="Main-Class" value="org.joshuad.musicplayer.MusicPlayerUI" /&gt;
                  &lt;attribute name="Class-Path" value="lib/commons-cli-1.4.jar lib/jaad-0.8.4-nospi.jar
                                                      lib/jaudiotagger-2.2.6-SNAPSHOT.jar lib/jflac-1.2.jar
                                                      lib/jl1.0.1.jar lib/jogg-0.0.7.jar lib/jorbis-0.0.15.jar
                                                      lib/vorbisspi1.0.3.jar" /&gt;
              &lt;/manifest&gt;
          &lt;/jar&gt;
      &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>