ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject RE: FW: Can't find the files
Date Fri, 06 Apr 2001 17:21:29 GMT
Hi Pinar,

The idea of using a property to specify the path up to the point where the
JDK's subdir structure kicks in is to allow the build to work without
requiring that everyone has the JDKs in the same place -- it's what the
"jdk118root" and "jdk122root" properties are for. For example, on your
machine, they live in d:/jdk1.1.8 and d:/jdk1.2.2, but on someone else's
machine they could live in, say, z:/java, or /usr/local/tools, etc. So,
what you want is to have the build.xml file reference ${jdk118root} and
${jdk122root}, rather than hard-coding in those locations. Then -- and
this is the part where you need to decide how you want things to work in
your specific process -- the values for ${jdk118root} and ${jdk122root}
need to be defined when 'ant' is run. You can do that by saying people are
required to have a properties file in their home directory that defines
them, or you can define them on the command line (like I showed you
earlier), or you can have them set as environment variables, etc. It's not
possible to tell you exactly how to do this part -- it's really up to how
you want to set things up.  That's why I told you to just define them on
the command line at first so you can get the hang of how it's going to
work -- it's not the way I'd recommend you actually implement things.

Let's say that you decide you want to require that users have a properties
file in their home directory, called "", which defines where
the JDKs live on their machine -- for example, your would

whereas mine would contain, say:

Then, in your build.xml file, you would read in that file, *before* you
reference the ${jdk118root} and ${jdk122root} properties, using:
<property file="${user.home}/"/>

That gets ${jdk118root} and ${jdk122root} defined, and with the values
specific for the user.

Then, in your build.xml file you would set the paths to the JDK classes,
being sure to *reference* the ${jdk118root} and ${jdk122root} properties:
<property name="Java122Classes" value="${jdk122root}"/jre/lib/rt.jar"/>
<property name="Java118Classes" value="${jdk118root}"/lib/"/>

Or, you could put those property definitions in a properties file:

and read that file in as well (in this example, called "",
and living in the same directory as your build.xml file:
<property file=""/>

but you *wouldn't* both set the individual properties in build.xml and
read in a properties file that defines them -- choose the method that you

Now, when you run 'ant' the full-path to your 1.2.2 rt.jar file will
become d:/jdk1.2.2/jre/lib/rt.jar -- but when I run 'ant', the full-path
to the jar will become /usr/local/tools/java/jdk122/jre/lib/rt.jar.

Hope this helps,

--- Pinar Bicioglu <> wrote:
> Just for trying, since my JDKs live in D drive in my machine, I wrote
> <property name="$Java122Classes" value="d:/jdk1.2.2/jre/lib/rt.jar" />
> <property name="Java118Classes" value="d:/jdk1.1.8/lib/" />
> in my "" file. After deleting
> <property name= " Java122Classes" value="/jdk122/jre/lib/rt.jar" />
> <property name= " Java118Classes" value="/jdk118/jre/lib/" />
> lines from build.xml file, I wrote 
> <property file="" /> on the top of build.xml file. 
> So it's suppose to go and find files and work correctly right? but it's
> not
> working and I don't know what I am doing wrong here :(
> -----Original Message-----
> From: Diane Holt []
> Sent: Friday, April 06, 2001 11:59 AM
> To:
> Subject: Re: FW: Can't find the files
> --- Pinar Bicioglu <> wrote:
> > :) Not really. I have been still working on that. I made a properties
> > file containing 
> > 
> > <property name="Java122Classes"
> > value="${jdk122root}/jdk1.2.2/jre/lib/rt.jar" />\
> > <property name="Java118Classes"
> > value="${jdk118root}/jdk1.1.8/lib/" />
> > 
> > then I added the <properties name=""/> line on the top
> > of my build.xml file. But it still not working. I also tried Nico's
> and
> > Anuj's suggestions but no result!! I think I am messing something up
> > here!
> You would read in a properties file called using the
> file
> attribute, not the name attribute:
>   <property file=""/>
> You also need to set the "jdk122root" and "jdk118root" properties to the
> appropriate path. For example, if the JDK jars on your machine live in,
> say, d:/java/tools, then you need to get the "jdk122root" and
> "jdk118root"
> properties set to that before you run 'ant'. You can do that in a number
> of different ways, and the way you choose depends on how you've designed
> your build process. For now, just to get things working so you can at
> least get past this hump, try just defining it on the 'ant' command
> line:
> C:\> ant -Djdk122root=d:/java/tools -Djdk118root=d:/java/tools
> substituting "d:/java/tools" for the actual path of where your two JDKs
> live on your machine.
> Diane 
> =====
> (
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail. 


Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.

View raw message