background image

Running the Samples

<< Configuring Your Environment | Sample XML Document >>
<< Configuring Your Environment | Sample XML Document >>
R
UNNING THE
S
AMPLES
101
3. You may also need to specify the path to the
asant
command in your
PATH
environment variable; for example, on UNIX/Linux:
export PATH=$PATH:/opt/SUNWappserver/bin/
or, on Windows:
set PATH=%PATH%;c:\Sun\AppServer\bin
asant
is a script wrapper around the implementation of Ant bundled with
the J2EE 1.4 Tutorial. Be sure to use this Ant implementation when run-
ning the tutorial samples rather than any other Ant implementation you
may have installed on your system. Also be sure to use the
asant
wrapper
rather than running Ant directly.
4. Finally, note that the
build.xml
files in the various
stax
sample directo-
ries include classpath references to
<javaee.home>/lib/javaee.jar
and
<javaee.home>/lib/appserv-ws.jar
. You should not change these val-
ues, and if you create your own
build.xml
files, be sure to include these
classpath references.
Running the Samples
The samples are run by means of the
asant
Ant wrapper and three build targets,
defined in the
<javaee.tutorial.home>/stax/samples/build.xml
file. When
you run any of the samples, the compiled class files are placed in a directory
named
./build
. This directory is created if it does not exist already.
Note: As mentioned above, be sure to use the implementation of Ant bundled with
the J2EE Tutorial rather than any version of Ant you may already have installed on
your system. Also be sure to use the
asant
wrapper script rather than running Ant
directly.
There is a separate
build.xml
file in each of the
stax
sample directories except
common
, and each
build.xml
file provides the same three targets. Switch to the
directory containing the sample you want to run, and then run the desired
build.xml
target from there.