Command-Line Interface
The IBM® WebSphere® sMash command-line interface provides the basic support for developing and executing WebSphere sMash 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>.zip. 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. - Configure the java command by setting the environment variable JAVA_HOME.
The zero scripts try to determine the java command to use by first using the environment variable JAVA_HOME. JAVA_HOME should be set to the directory where the JDK is installed. The scripts will append bin/java to JAVA_HOME and check to see if the file exists. If JAVA_HOME is not set, or ${JAVA_HOME}/bin/java does not exist, then the script will use the java command found using the configured path. The preferred solution is to set JAVA_HOME.
If a proxy is required to access external sites, then the zero scripts need to be configured for the proxy, for example setting the proxyHost and proxyPort. The zero commands will download required modules, so the proxy needs to be configured.
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 WebSphere sMash 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 :
- Stop the application.
zero stop - Add the PHP dependency to the application. Within your application's directory, edit
config/ivy.xml. Add the entry<dependency name="zero.php" org="zero" rev="[1.0.0.0, 2.0.0.0["/>to thedependencieselement. - Find the new dependency and associate it with your application. This step is called resolving the dependency.
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.