AnsweredAssumed Answered

ANT Build javac error.

Question asked by jeremy on Sep 1, 2010
Latest reply on Sep 2, 2010 by jeremy

When I attempt to build alfresco using the command

ant build-tomcat

the build fails. The fail message is:

c:\Documents and Settings\Owner\Desktop\Alfresco\Downloads\Alfresco\Alfresco Core\projects.xml:882:  The following error occured while executing this line: c:\Documents and Settings\Owner\Desktop\Alfresco\Downloads\Alfresco\Alfresco Core\macros.xml:28: Error running c:\Program Files\Java\jdk1.6.0_21\bin\javac.exe compiler

Line 28 of macros.xml  is highlighted in red, in the code snipet below.

<macrodef name="compile-java" description="Compiles Java source files in the given project">
      <attribute name="projectdir" />
      <attribute name="compileExcludes" default="" />
      <element name="addPath" optional="yes" />
         <mkdir dir="@{projectdir}/${}/${}" />
         <javac destdir="@{projectdir}/${}/${}" fork="true"
                memoryMaximumSize="${mem.size.max}" deprecation="${javac.deprecation}"
                debug="${javac.debug}"  target="${}" source="${javac.source}" encoding="${javac.encoding}"
                excludes="@{compileExcludes}" >
            <src path="@{projectdir}/${}/${}" />
            <path refid="classpath.compile"/>
            <path refid="classpath.compile.extension"/>

            <!– To run javac with Xlint:unchecked, uncomment the line below  –>
            <!– <compilerarg value="-Xlint:unchecked"/> –>


Line 882 of projects.xml  is highlighted in red, in the code snipet below.

   <target name="package-solr"
      <mkdir dir="${dir.project.solr.dist}" />
      <jar jarfile="${dir.project.solr.dist}/${}"
           basedir="${dir.project.solr.classes}" />
   <target name="test-solr"
      <run-tests projectdir="${dir.project.solr}" />
   <target name="generate-javadocs-solr"
      <generate-javadocs documenttitle="Alfresco SOLR integration ${version.number}"
                         windowtitle="Alfresco SOLR Integration"

   <!– ******************************************************************** –>
   <!– ** Tomcat-virtserver Project                                         –>
   <!– **                                                                   –>
   <!– **   Normally, you just want to build the various .jar files used    –>
   <!– **   by the virtualization server, not the virtualization server     –>

I have read the other posts that relate to building Alfresco. I tried modifying macros.xml by inserting the code

<compilerarg value="-Djava.endorsed.dirs=${dir.project.3rdparty.lib}" />

as Pawan advised in an earlier post. This did not work.

I do have JDK 1.6.0_21 installed. I checked the javac is working in the command prompt.

Can you please let me know what I should do from here ?