0

I write a java package, and I want to compile it into .class files first and then package it. Following codes are what I do in my ant script. Under the directory of "src/compressScript" are four java class I wrote.

<?xml version="1.0" encoding="UTF-8" standalone="no"?><project basedir="."default="compileJava" name="compileJava">


<target name="compileJava">
        <mkdir dir="buildTest"/>
        <javac includeantruntime="false" srcdir="src/compressScript" destdir="buildTest"/>
</target>

</project>

When I try to use javac task of ANT to run this scirpt, the error is like this: Buildfile: C:\Users\di_yu\workspace\AffirmedNetworks\buildTest.xml compileJava:

BUILD FAILED
C:\Users\di_yu\workspace\AffirmedNetworks\buildTest.xml:6:java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main : Unsupported major.minor version 52.0

Total time: 545 milliseconds

I check my compiler, the installed JRE is JRE 7.0 and the compiler compliance level is 1.7. So what's the problem?

diCoder
  • 181
  • 2
  • 3
  • 14

0 Answers0