ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peterson, Lance" <>
Subject RE: Classpath
Date Thu, 12 Apr 2001 20:00:33 GMT

I think you need to specify the full path to the j2ee/lib directory in your
fileset.  The path attribute in your classpath element does not set a base
path for nested elements.  Thus

      <classpath path="${j2ee_home}">
        <fileset dir="lib" />
          <include name="j2ee.jar" />

is equivalent to...

        <pathelement path="${j2ee_home}" />
        <fileset dir="lib" />
          <include name="j2ee.jar" />

I think this might be what you're looking for...

        <fileset dir="${j2ee_home}/lib" />
          <include name="j2ee.jar" />

And this is how I usually include jar files in my classpath.  As you can see
it's a little more compact.

        <pathelement location="${j2ee_home}/lib/j2ee.jar" />

Best regards,
Lance Peterson
Verticore Technologies Inc.

-----Original Message-----
From: Jim Downing []
Sent: Thursday, April 12, 2001 10:57 AM
Subject: Classpath

Apologies for being stupid here - 

I'm trying to get a javac task to have  a classpath that points to a jar
file that isn't in the build base directory.  The location of the jar is in
a path specified by 
an environment variable.  Is it possible to get a fileset to point to this
environment specified directory?

My build.xml:

<project name="dbAccessTest" default="compile">
  <property name="src" value="src"/>
  <property name="build" value="build"/>
  <property environment="env"/>
  <property name="j2ee_home" value="${env.J2EE_HOME}"/>
  <property name="java_home" value="${env.JAVA_HOME}"/>
  <target name="init">
    <delete dir="${build}"/>
    <mkdir dir="${build}"/>
    <mkdir dir="${build}/lib"/>
    <mkdir dir="${build}/classes"/>

  <target name="compile" depends="init">
    <javac srcdir="${src}" destdir="${build}/classes"
      <classpath path="${j2ee_home}">
        <fileset dir="lib">
          <include name="j2ee.jar"/>


View raw message