You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by amol desai <am...@yahoo.com> on 2002/08/22 22:13:23 UTC

Set system classpath through ant

Hi,

 How can we set the system classpath thrpough ant
script?

Your help will be appreciated.

Thanks,

-Amol


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Set system classpath through ant

Posted by Jacob Kjome <ho...@visi.com>.
Hello amol,

What would be your reason for doing this?  If you did manage to set
the system classpath, it would only survive while the current JVM
instantiated by Ant is running.

You can set your own classpath and can put that before or after the
system classpath using values which build.sysclasspath allows for
including only, ignore, first, and last.

You can build your own classpath like this (and reference them with
refid)...


    <path id="compile.classpath">

        <!-- Include all JAR files that will be included in /WEB-INF/lib -->
        <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** -->
        <!--
        <pathelement location="${foo.jar}"/>
        -->
        <pathelement location="${plankton.jar}"/>
        <pathelement location="${log4j.jar}"/>
        <pathelement location="${cos.jar}"/>
        <pathelement location="${prevayler.jar}"/>

        <pathelement location="${fop.jar}"/>
        <pathelement location="${xsltc.jar}"/>

        <!-- Include all elements that Tomcat exposes to applications -->
        <pathelement location="${catalina.home}/common/classes"/>
        <fileset dir="${catalina.home}/common/endorsed">
            <include name="*.jar"/>
        </fileset>
        <fileset dir="${catalina.home}/common/lib">
            <include name="*.jar"/>
        </fileset>
        <pathelement location="${catalina.home}/shared/classes"/>
        <fileset dir="${catalina.home}/shared/lib">
            <include name="*.jar"/>
        </fileset>

    </path>


    You can have multiple paths and reference the first path like
    below.
    
    <path id="compile.test.classpath">
        <pathelement location="${build.home}/WEB-INF/classes"/>
        <path refid="compile.classpath"/>
    </path>


The, just use <classpath refid="compile.classpath" /> inside tasks
like <javac> and such to refer to any paths that you've created.


Jake


Thursday, August 22, 2002, 3:13:23 PM, you wrote:


ad> Hi,

ad>  How can we set the system classpath thrpough ant
ad> script?

ad> Your help will be appreciated.

ad> Thanks,

ad> -Amol


ad> __________________________________________________
ad> Do You Yahoo!?
ad> HotJobs - Search Thousands of New Jobs
ad> http://www.hotjobs.com

ad> --
ad> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
ad> For additional commands, e-mail: <ma...@jakarta.apache.org>



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>