Estou começando a usar o Ant no Eclipse.
Tenho o seguinte:
public class HelloAnt {
public static void main(String[] args) {
System.out.println("Hello Ant!");
}
}
<?xml version="1.0"?>
<project name="AntProject" default="compile" basedir=".">
<property name="class" value="class"/>
<target name="init">
<echo>Criando Diretorios</echo>
<mkdir dir="${class}"/>
</target>
<target name="compile" depends="init">
<echo> Compilando </echo>
<javac srcdir="." destdir="${class}"/>
</target>
</project>
Executei o Ant e tive o seguinte erro:
Buildfile: C:\Eclipse\workspace\AntProject\Build.xml
init:
[echo] Criando Diretorios
compile:
[echo] Compilando
[javac] Compiling 1 source file to C:\Eclipse\workspace\AntProject\class
[javac] C:\Eclipse\workspace\AntProject\HelloAnt.java:16: cannot access java.lang.Object
[javac] bad class file: C:\Arquivos de programas\Java\jre1.5.0_02\lib\rt.jar(java/lang/Object.class)
[javac] class file has wrong version 49.0, should be 48.0
[javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
[javac] public static void main(String[] args) {
[javac] ^
[javac] 1 error
BUILD FAILED: C:\Eclipse\workspace\AntProject\Build.xml:14: Compile failed; see the compiler error output for details.
Total time: 2 seconds
Na maquina tá instalado o jsdk1.4.2_06 e o jdk1.5.0_01 com NetBeans.
Pode ser algum conflito?