1

I am trying to compile my java source code to target 1.8. I have set the following in the javac target.

Ant version: Apache Ant(TM) version 1.9.4 compiled on April 29 2014
Java version: 1.8

<target name="compile" depends="prepare">
    <echo>Mayuran</echo>
    <echo>Ant version: ${ant.version}</echo>
    <echo>java version: ${ant.java.version}</echo>
    <javac srcdir="${buildpath.src}" source="1.8" target="1.8" destdir="${buildpath.out}" classpathref="build.classpath" debug="${build-classes.debugOption}" includeantruntime="${build.inclAntRTOption}"/>
</target>

But when i check the generated class file using the javap tool, it is still showing the class files is major 52(JDK 7)

javap -classpath . -verbose com.mayuran.Test

Does anyone has idea why it is happening?

Regards, Mayuran

Mayuran
  • 669
  • 2
  • 8
  • 39
  • Nothing obviously wrong to my eyes. Try adding `verbose="yes"` to your `javac` task to see if that reveals anything else. Also, ensure the `.class` file is in `destdir` and has been freshly built by deleting prior to Ant execution. – Mark A. Fitzgerald Apr 28 '16 at 04:28
  • Thanks for input, I have verified that class files are newly created. Still not able to figure it out. going to try with verbose option – Mayuran Apr 28 '16 at 05:23
  • 1
    Sorry my bad, Major version 52 is JDK 8 already. – Mayuran Apr 28 '16 at 06:56
  • Then you can remove your question – Holger Apr 28 '16 at 08:36

0 Answers0