调用 Ant api 出现Compile failed; see the compiler error output for details异常

[b][color=red][color=red][color=red]该方法是把d:/generator-output/hibernate/code/这个文件夹下的多个.java编译为.class文件[/color][/color][/color][/b]

但是出现Compile failed; see the compiler error output for details异常,希望大家帮忙解决,谢了

public boolean sourceConvertClass() {
boolean flag = false;
File f = new File("d:/generator-output/hibernate/code/");

    // 找到所有的文件
    File[] files = f.listFiles();
    Javac compiler = new Javac();
    File destFile = null;
    for (File file : files) {
        // 找出不含.java文件
        if (file.getName().contains(".java")) {
            compiler.setProject(new Project());
            // 编译后的.class文件存放的路径
            destFile = new File("d:/generator-output/hibernate/code/");
            destFile.mkdirs();
            // 要编译的源文件目录
            Path srcPath = new Path(compiler.getProject(),
                    "d:/generator-output/hibernate/code/");
            compiler.setFork(true);
            compiler.setSrcdir(srcPath);
            compiler.setDestdir(destFile);
            try {
                compiler.execute();
                flag = true;
            } catch (BuildException e) {

                //System.out.println("编译.class文件出现错误");
            }
        }

    }

    return flag;
}

我记得也遇到过这样的情况。我当初没有编译。但当我编译了,就没有错 了。我也没有管了。你看看是否ToMact给的内存够吗?

请问你怎么解决的呀?