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
- Download the
zero-<version>.zipfrom CLI Download. Accept the license agreement then clickzero-<version>.zipto download. - Unzip
zero-<version>.zipinto any directory(see note). The root directory after unzipping will be called zero, we will refer to this directory as<zerohome>. - Add
<zerohome>to the PATH environment variable. - 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
- Open a command prompt.
- Type the following:
-
zero create demo - To create a new Project Zero application (created in a new subdirectory called demo)
-
- Change directory into
demo. - Type
zero startto start the application. Log messages are printed showing that the HTTP adapter has started (for example xxxxxx running on port 8080). - 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 :
- Add the PHP dependency to the application. Edit
config/ivy.xml. Add the entry<dependency name="zero.php" org="zero" rev="1.0+"/>to thedependencieselement. - Stop the application and resolve the new dependency.
zero stop
zero resolve - Add PHP scripts to the application's
publicdirectory. - Optionally modify the settings in the PHP configuration file
config/php.ini. - Start the application.
- 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.