I'm a little baffled by what I'm seeing, and don't really know how to get around it. I found a
thread here and there that mentioned it, but it was dealing with
Ant not specifically running from within Eclipse Indigo (the non-EE version).
I have an Ant build file, and am doing a pretty simple compile, but it has a few excludes. It looks something like this:
source.dir, by the way, is set to . (single dot, ie: current directory)
SOMETIMES it works, but often it fails with the following message:
[javac] The system is out of resources.
[javac] Consult the following stack trace for details.
[javac] java.lang.OutOfMemoryError:
Java heap space
[javac] at com.sun.tools.javac.tree.TreeMaker.Unary(TreeMaker.java:353)
[javac] at com.sun.tools.javac.parser.Parser.term3(Parser.java:864)
[javac] at com.sun.tools.javac.parser.Parser.term2(Parser.java:686)
[javac] at com.sun.tools.javac.parser.Parser.term1(Parser.java:657)
[javac] at com.sun.tools.javac.parser.Parser.term(Parser.java:613)
[javac] at com.sun.tools.javac.parser.Parser.term(Parser.java:595)
[javac] at com.sun.tools.javac.parser.Parser.expression(Parser.java:585)
[javac] at com.sun.tools.javac.parser.Parser.parExpression(Parser.java:1453)
[javac] at com.sun.tools.javac.parser.Parser.statement(Parser.java:1609)
[javac] at com.sun.tools.javac.parser.Parser.blockStatements(Parser.java:1499)
[javac] at com.sun.tools.javac.parser.Parser.block(Parser.java:1462)
[javac] at com.sun.tools.javac.parser.Parser.block(Parser.java:1476)
[javac] at com.sun.tools.javac.parser.Parser.statement(Parser.java:1606)
[javac] at com.sun.tools.javac.parser.Parser.statement(Parser.java:1610)
[javac] at com.sun.tools.javac.parser.Parser.blockStatements(Parser.java:1499)
[javac] at com.sun.tools.javac.parser.Parser.block(Parser.java:1462)
[javac] at com.sun.tools.javac.parser.Parser.block(Parser.java:1476)
[javac] at com.sun.tools.javac.parser.Parser.statement(Parser.java:1606)
[javac] at com.sun.tools.javac.parser.Parser.statement(Parser.java:1646)
[javac] at com.sun.tools.javac.parser.Parser.blockStatements(Parser.java:1499)
[javac] at com.sun.tools.javac.parser.Parser.block(Parser.java:1462)
[javac] at com.sun.tools.javac.parser.Parser.block(Parser.java:1476)
[javac] at com.sun.tools.javac.parser.Parser.statement(Parser.java:1660)
[javac] at com.sun.tools.javac.parser.Parser.blockStatements(Parser.java:1499)
[javac] at com.sun.tools.javac.parser.Parser.block(Parser.java:1462)
[javac] at com.sun.tools.javac.parser.Parser.block(Parser.java:1476)
[javac] at com.sun.tools.javac.parser.Parser.methodDeclaratorRest(Parser.java:2532)
[javac] at com.sun.tools.javac.parser.Parser.classOrInterfaceBodyDeclaration(Parser.java:2481)
[javac] at com.sun.tools.javac.parser.Parser.classOrInterfaceBody(Parser.java:2408)
[javac] at com.sun.tools.javac.parser.Parser.classDeclaration(Parser.java:2253)
[javac] at com.sun.tools.javac.parser.Parser.classOrInterfaceOrEnumDeclaration(Parser.java:2191)
[javac] at com.sun.tools.javac.parser.Parser.typeDeclaration(Parser.java:2180)
BUILD FAILED
Oddly, when it does fail, I get warnings about non-UTF-8 characters, but when it succeeds, I get no such warnings.
My eclipse.ini looks as follows (only the last 2 lines are changed from what was already there)
So, I've tried changing my javac line to read as follows
Alternately I've tried saying fork="true" instead... both give me the same result - I get the following message:
[echo] Running the Main Build Task
[javac] Compiling 2584 source files
[javac] javac: invalid flag: E:\myprojectdir
[javac] Usage: javac <options> <source files>
[javac] use -help for a list of possible options
BUILD FAILED
By the way, E:\myprojectdir is the directory wherein my project exists, as well as where the build.xml files exist. I didn't set it up this way, but I'm not allowed to change it. The .class files are supposed to wind up in the directories where their corresponding .java files exist.
So, I don't know why setting the fork value causes the failure that it does. Is there any way around the out of heap space error, preferably via changes within the build.xml file itself? Running Ant separately outside of Eclipse is not an option for me, either, and I don't know if that'll change any time soon or not.
Also, anyone know why the fork option gives me the odd results that it does?
Thanks. As you might guess, I'm rather new to dealing with Ant on anything more than the simplest level.