Saturday, October 10, 2009

Ant build javac compiler error

Last week I was using Ant 1.7.1 to compile the alfresco source code. I was using the JDK1.6.0.14.
The build file was giving the error
Error running .../javac.exe compiler

I rechecked the JAVA_HOME and ANT_HOME were set to correct location.

I checked the build file for error line. It was


destdir="@{projectdir}/${dir.name.build}/${dir.name.classes}"
fork="true"
memoryMaximumSize="${mem.size.max}"
debug="${javac.debug}"
target="${javac.target}"
source="${javac.source}"
encoding="${javac.encoding}"
excludes="@{compileExcludes}"
>

What I did was removed the attribute

fork="true"
memoryMaximumSize="${mem.size.max}"

And the build was successful this time.