ant-user mailing list archives

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

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" />
        </fileset>
      </classpath>

is equivalent to...

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

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

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

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

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

Best regards,
Lance Peterson
Verticore Technologies Inc.

-----Original Message-----
From: Jim Downing [mailto:jimdowning@crosswinds.net]
Sent: Thursday, April 12, 2001 10:57 AM
To: ant-user@jakarta.apache.org
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">
    <tstamp/>
    <delete dir="${build}"/>
    <mkdir dir="${build}"/>
    <mkdir dir="${build}/lib"/>
    <mkdir dir="${build}/classes"/>
  </target>

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

Jim


Mime
View raw message