Java[tm] BluePrints for Wireless Gaming Sample Applications 1.0 Early Access > Building and Running the Sample Applications |
Ant, a tool with similar functionality to make, is used to build the sample applications, 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 applications bundle.
Before building the sample applications, make sure your environment variables are set as specified in the installation instructions.
To build the sample application, bring up a shell or command
prompt, change the current directory to
{blueprints.dir}/src/apps/jbricks/src
or
{blueprints.dir}/src/apps/slugs/src
, and type:
build.sh
<argument> (Solaris or
Linux)
build.bat
<argument> (Windows)
The following table lists arguments you can use with the build
scripts in {blueprints.dir}/src/apps/jbricks/src
, and
what using each of these arguments accomplishes.
Argument | Purpose |
---|---|
all |
Builds the entire application. (This is the default target.) |
clean |
Cleans out the build output directories. |
emulate |
Runs the application in the emulator. |
When the build script is invoked with no arguments, it will build the entire application.
The application is placed in:
{blueprints.dir}/src/apps/jbricks/build/
The following table lists arguments you can use with the build
scripts in {blueprints.dir}/src/apps/slugs/src
, and
what using each of these arguments accomplishes.
Argument | Purpose |
---|---|
all |
Builds the entire application. (This is the default target.) |
clean |
Cleans out the build output directories. |
emulate |
Runs an instance of the client in the emulator. (Note that you need at least two instances to start a game.) |
run-server |
Runs an instance of the server. (Note that you need one instance to start a game.) |
When the build script is invoked with no arguments, it will build the entire application.
The client and server parts of the application are placed in:
{blueprints.dir}/src/apps/slugs/build/
To run the binaries produced by the build, use the build scripts.
This sample application is a stand-alone game, so you just need to start the emulator.
Bring up a shell or command prompt.
Change the current directory to
{blueprints.dir}/src/apps/jbricks/src
.
Enter the following command:
build.sh emulate (Solaris or Linux)
build.bat emulate (Windows)
There are two parts to the Java Slugs sample application: A J2ME client, and a server using the J2SE APIs. You need one instance of the server and at least two instances of the client to start a game.
Run the server.
Bring up a shell or command prompt.
Change the current directory to
{blueprints.dir}/src/apps/slugs/src
.
Enter the following command:
build.sh run-server
(Solaris or Linux)
build.bat run-server
(Windows)
Run a client.
Bring up a shell or command prompt.
Change the current directory to
{blueprints.dir}/src/apps/slugs/src
.
Enter the following command:
build.sh emulate
(Solaris or Linux)
build.bat emulate
(Windows)
Run another client.
The Java Slugs sample application is a two-player game, so you need two emulators running. Just repeat the previous step once more.