Hi,
I am trying to build my project using ant tool, but it is erroring out as follows:
Buildfile: D:\My Software\eclipse\workspace\ShoppingCart\build.xmlprepare:compile: [javac] Compiling 2 source files to D:\My Software\eclipse\workspace\ShoppingCart\build\WEB-INF\classes [javac] Fatal Error: Unable to find package java.lang in classpath or bootclasspath BUILD FAILEDD:\My Software\eclipse\workspace\ShoppingCart\build.xml:46: Compile failed; see the compiler error output for details. Total time: 1 second
Please find the build.xml:
<project name="Shopping Cart" default="compile" basedir="."> <property name="app.name" value="ShoppingCart" /> <property name="app.path" value="/${app.name}" /> <property name="app.version" value="0.1-dev" /> <property name="build.home" value="${basedir}/build" /> <property name="catalina.home" value="C:\Program Files\Apache Software Foundation\Tomcat 5.0" /> <property name="dist.home" value="${basedir}/bin" /> <!--<property name="docs.home" value="${basedir}/docs" /> --> <property name="manager.url" value="http://localhost:8080/manager" /> <property name="src.home" value="${basedir}/src" /> <property name="web.home" value="${basedir}/web" /> <property name="lib.home" value="${basedir}/WEB-INF/lib" /> <target name="all" depends="clean,compile" description="Clean build and dist directories, then compile" /> <target name="clean" description="Delete old build and dist directories"> <delete dir="${build.home}" /> <delete dir="${dist.home}" /> </target> <target name="prepare"> <!-- Create build directories as needed --> <mkdir dir="${build.home}" /> <mkdir dir="${build.home}/WEB-INF" /> <mkdir dir="${build.home}/WEB-INF/classes" /> <!-- Copy static content of this web application --> <copy todir="${build.home}/web"> <fileset dir="${web.home}" /> </copy> <!-- Copy external dependencies as required --> <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> <mkdir dir="${build.home}/WEB-INF/lib" /> <copy todir="${build.home}/WEB-INF/lib"> <fileset dir="${lib.home}" /> </copy> <!-- Copy static files from external dependencies as needed --> <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> </target> <target name="compile" depends="prepare" description="Compile Java sources"> <!-- Compile Java classes as necessary --> <mkdir dir="${build.home}/WEB-INF/classes" /> <javac srcdir="${src.home}" destdir="${build.home}/WEB-INF/classes" bootclasspath="${lib.home}" source="1.5"/> <!-- Copy application resources --> <copy todir="${build.home}/WEB-INF/classes"> <fileset dir="${src.home}" excludes="**/*.java" /> </copy> </target> <target name="dist" depends="compile" description="Create binary distribution"> <!-- Copy documentation subdirectories <mkdir dir="${dist.home}/docs" /> <copy todir="${dist.home}/docs"> <fileset dir="${docs.home}" /> </copy> --> <!-- Create application JAR file --> <jar jarfile="${dist.home}/${app.name}-${app.version}.war" basedir="${build.home}" /> <!-- Copy additional files to ${dist.home} as necessary --> </target> </project>
thnx,
Rakesh