| Java[tm] Smart Ticket Sample Application 1.2 > Building and Running the Sample Application |
Ant, a tool with similar functionality to make, is used to build the sample application, and to execute the binaries that are built. (Ant has been developed under the auspices of the Apache Software Foundation.) A working version of Ant is provided as part of the sample application bundle.
Before building the sample application, make sure your environment variables are set as specified in the installation instructions.
This section explains how to build the application binaries for the SmartTicket application. Building all the application binaries and performing other tasks with Ant involves invoking asant from <smartticket.home>/src directory of the demo installation.
To build the application binaries on Unix, open a shell prompt and enter these commands:
cd <smartticket.home>/srcTo build the application binaries on Windows, open a shell prompt and enter these commands:
asant [argument]
cd <smartticket.home>\srcFor the above command to work, your PATH environment variable must have been set as explained in the installation instructions and the ANT_HOME environment variable, if any, should not point to any other version of ant that might be on your system.
asant [argument]
J2MEWTK.HOME in <smartticket.home>/src/build.properties
to the root directory of your J2ME Wireless Toolkit installation. For
example, if you installed the toolkit in /usr/local/java/wtk104
or c:/wtk104 (use Unix format slash "/" as the file separator in build.properties for all platforms), then that path should be the value of J2MEWTK.HOME.When the asant is invoked with no arguments, it will build the entire application.
The client part of the application is placed in:
<smartticket.home>/src/app/client/midp/build/
<smartticket.home>/src/app/client/midp-optimized/build/
The server part of the application is placed in:
<smartticket.home>/src/app/server/build
<smartticket.home>/smart_ticket.ear
<smartticket.home>/smart_ticket-client.jar
<smartticket.home>/smart_ticket-client.jad
<smartticket.home>/smart_ticket-client-optimized.jar
<smartticket.home>/smart_ticket-client-optimized.jad
The following table lists arguments you can use with the asant
in <smartticket.home>/src, and what using each of these
arguments accomplishes.
| Argument | Purpose |
|---|---|
core |
Builds the entire application. (This is the default target.) |
clean |
Cleans out the build output directories. |
emulate |
Runs the MIDP client part in the emulator. |
deploy |
Deploys the J2EE server part on the J2EE SDK server. |
undeploy |
Undeploys the J2EE server part from the J2EE SDK server. |
populate |
Display instructions to populate the database. |