Java[tm] Smart Ticket Demo 1.1.1 > Building the Sample Application |
You can use Ant, a tool with similar functionality to make, to build the application. Ant has been developed under the auspices of the Apache Software Foundation. A working version of Ant is provided as part of the Java Smart Ticket Demo distribution.
Before building the application, make sure your environment variables are set as specified in the installation instructions.
To invoke the version of Ant that is packaged with the Java Smart Ticket Demo, bring up a shell or command prompt and type:
localant
<argument>
When localant
is invoked with no argument, it will build the
entire application.
The following table lists some arguments you can use, and what using these arguments accomplishes.
Argument | Purpose |
---|---|
all |
Builds the entire application. (This is the default target.) |
midp |
Builds the MIDP client part of the application. |
j2ee |
Builds the J2EE server part of the application. |
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. |
The midp
target can also be invoked with an additional
parameter to specify the default locale for the MIDP client:
localant -Dmidp.locale=<locale> midp
The locale argument takes the form xx_YY
. For example,
to set the default locale to Japanese, ja_JP
, you would
use the following command:
localant -Dmidp.locale=ja_JP midp
In order to build the MIDP client to use a particular default locale, a file containing the messages for that locale must be named as:
{smarticket.dir}/messages/<locale>.properties
The locale part takes the form xx_YY
. For example, the
Japanese localized messages are in the following file:
{smarticket.dir}/messages/ja_JP.properties
If no locale is specified the default is American English
(en_US
).
To properly display a particular set of localized messages on the J2ME Wireless Toolkit emulator, you may need to change the toolkit's default character encoding. See Configuring the Sample Application for additional information.