AnsweredAssumed Answered

ANT Build javac error.

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

When I attempt to build alfresco using the command

ant build-tomcat

the build fails. The fail message is:

BUILD FAILED
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" />
      <sequential>
         <mkdir dir="@{projectdir}/${dir.name.build}/${dir.name.classes}" />
         <javac destdir="@{projectdir}/${dir.name.build}/${dir.name.classes}" fork="true"
                memoryMaximumSize="${mem.size.max}" deprecation="${javac.deprecation}"
                debug="${javac.debug}"  target="${javac.target}" source="${javac.source}" encoding="${javac.encoding}"
                excludes="@{compileExcludes}" >
            <src path="@{projectdir}/${dir.name.source}/${dir.name.java}" />
            <classpath>
            <addPath/>
            <path refid="classpath.compile"/>
            <path refid="classpath.compile.extension"/>
         </classpath>

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

         </javac>


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

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


   <!– ******************************************************************** –>
   <!– ** 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 ?

Thanks.

Outcomes