Java[tm] Smart Ticket Sample Application 2.0 Early Access > Building and Running the Sample Application

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.

Building the Sample Application

To build the sample application, bring up a shell or command prompt, change the current directory to {smart_ticket.dir}/src, and type:

build.sh <argument> (Solaris or Linux)

build.bat <argument> (Windows)

The following table lists arguments you can use with the build script in {smart_ticket.dir}/src, and what using each of these arguments accomplishes.

Arguments for the build script
Argument Purpose
all 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.
cleandb Cleans the J2ME Wireless Toolkit RMS data store.
deploy Deploys the J2EE server part on the J2EE SDK server.
undeploy Undeploys the J2EE server part from the J2EE SDK server.

When the build script is invoked with no arguments, it will build the entire application.

The client part of the application is placed in:

{smart_ticket.dir}/src/app/client/midp/build/

The server part of the application is placed in:

{smart_ticket.dir}/src/app/server/build/

Running the Sample Application

To run the binaries produced by the build, use the build scripts. These instructions describe how to run the sample application using the J2EE SDK and the J2ME Wireless Toolkit on a single machine.

  1. Start the Cloudscape database server, which comes with the J2EE SDK.

  2. Start the J2EE Reference Implementation server, which comes with the J2EE SDK.

  3. If you're running the J2EE part of the application for the very first time, or if you've modified code in the J2EE part that accesses the database, follow these steps:

  4. If you've modified code in the J2ME part that accesses the local database (Record Management Store), or if the local database is out of sync with the database used by the J2EE part (for example, if you've redeployed the J2EE part of the application), follow these steps:

  5. Run the MIDP part of the application.

  6. A phone emulator will appear, showing the Java Smart Ticket Sample Application splash screen.

You can now use the application.


© 2002, 2003 Sun Microsystems, Inc. All rights reserved.