I have a major.minor version 51.0 exception in my java code. I am using Ant to compile and run.
I understand that this issue is because my java code is being compiled as 1.7 and then being run as 1.6. However in my Ant script I am explicitly targeting 1.6 and cant find the issue.
My ant script is below:
<?xml version="1.0" encoding="windows-1252" ?>
<!--Ant buildfile generated by Oracle JDeveloper-->
<!--Generated 07-Mar-2014 09:29:47-->
<project name="SVN Test" default="all" basedir=".">
<path id="classpath">
<fileset dir="${basedir}/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<property name="classes" value="${basedir}/target/classes"/>
<property name="javac.debug" value="on"/>
<property name="javac.nowarn" value="off"/>
<property name="javac.deprecation" value="off"/>
<property name="jar.dir" value="${basedir}/target/jar"/>
<property name="jar.name" value="jiraClient.jar"/>
<target name="clean">
<tstamp/>
<delete includeemptydirs="true" quiet="true">
<fileset dir="${classes}" includes="**/*"/>
</delete>
</target>
<target name="init">
<tstamp/>
<mkdir dir="${classes}"/>
<mkdir dir="${jar.dir}"/>
</target>
<target name="compile" depends="init">
<javac destdir="${classes}" classpathref="classpath"
debug="${javac.debug}" nowarn="${javac.nowarn}"
deprecation="${javac.deprecation}" encoding="Cp1252" source="1.6"
target="1.6">
<src path="${basedir}/src/main/java"/>
</javac>
</target>
<target name="run" depends="init, compile">
<java classname="uk.co.griffithswaite.jiraclient.jiraClient">
<classpath>
<pathelement location="${classes}"/>
<path refid="classpath"/>
</classpath>
</java>
</target>
</project>
My JAVA_HOME is C:\Oracle\Middleware\jdk160_24 My java -version is "1.6.0_24" My Ant version is "1.7.1"
I don't understand how I am getting a 51.0 exception when my Ant is 1.6?