I’m almost certain I can’t really do this without writing my own Task classes, but I thought I’d ask anyway. Is there some magic property or ant task that works just like <javac>, but runs my $JAVA_HOME/bin/javac executable file instead of running the code from the javac classes in $JAVA_HOME/lib/tools.jar? The reason I’d like to do this is because I can change the javac binary to always compile with Xlint, it’d be nice to have all the build.xml files around do that too without editing them. (And some have implicit javac calls through other tasks…) The compiler attribute of <javac> is meant for the class code, it doesn’t let you simply specify a file to run.
I’m almost certain I can’t really do this without writing my own Task classes,
Share
The Javac task has the
forkattribute, and also theexecutableone. Combine these.Also, you might want to set
compiler=extJavac, though I’m not sure if this changes something.Here is a quote from the examples section: