Installing and configuring: Command-Line Interface

The Zero command-line interface provides the basic support for developing and executing Zero applications.

Prerequisites

The following prerequisites are required to use the command line tools:

  • Windows, Linux, or Mac operating system
  • Java SE Development Kit (JDK) 5.0 or 6.0
    • Note: IBM employees should download the Java SDK from the IBM internal site.

Installation

  1. Download the zero-<version>.zip from CLI Download. Accept the license agreement then click zero-<version>.zip to download.
  2. Unzip zero-<version>.zip into any directory(see note). The root directory after unzipping will be called zero, we will refer to this directory as <zerohome> .
  3. Add <zerohome> to the PATH environment variable.
  4. Add the bin directory under the JDK installation directory to the PATH environment variable.

provides no Double-Byte Character Set (DBCS) support on the installation path.

Getting started

  1. Open a command prompt.
  2. Type the following:
    zero create demo
    To create a new Project Zero application (created in a new subdirectory called demo)
  3. Change directory into demo .
  4. Type zero start to start the application. Log messages are printed showing that the HTTP adapter has started (for example xxxxxx running on port 8080).
  5. From the browser type http://localhost:8080/. A page indicates that the application is running.

Adding PHP support (Optional)

If you want to add PHP support for your application, follow the steps below :

  1. Add the PHP dependency to the application. Edit config/ivy.xml . Add the entry <dependency name="zero.php" org="zero" rev="1.0+"/> to the dependencies element.
  2. Stop the application and resolve the new dependency.
    zero stop
    zero resolve
  3. Add PHP scripts to the application's public directory.
  4. Optionally modify the settings in the PHP configuration file config/php.ini .
  5. Start the application.
  6. From the browser type "http://localhost:8080/<name of script>.php" to execute the script.

To run PHP on Windows ensure you have the Microsoft C++ Runtime Libraries installed.

Version 1.0.0.0.17807