Ant in Eclipse: javac1.8 class not found








If you are running ANT in Eclipse using Java 8. The error
Class not found: javac1.8
could happen. Because Apache Ant versions less than 1.9.0 - are not compatible with Java 8. The solution could be
  • Option 1: Install Java 7 and set JAVA_HOME for eclipse to use Java 7.
  • Option 2: Add compiler or build.compiler attribute to the javac task in your ant build.xml:
    <target name="compile">
        <javac srcdir="src" destdir="build/classes" source="1.6" target="1.6" compiler="javac1.7" >
            <classpath>
                <fileset dir="lib">
                    <include name="*.jar" />
                </fileset>
            </classpath>
        </javac>
    </target>

see also




No comments:

Post a Comment