Installation
Use the following update site to install the WebSphere sMash Java/Groovy plug-in.
If you need assistance with this step, open the Eclipse Help browser (Help > Help Contents ) and search for the term install .
Next, to obtain Groovy language IDE support, install the appropriate version of the GroovyEclipse plugin as described in Groovy - Eclipse Plugin
Configuration
The following instructions assume that you have never installed the WebSphere sMash Java/Groovy plug-in, and that you are using a new workspace.
- Download and install a CLI. Please visit the Command-line interface section for details.
- Open a command prompt at the <zerohome> directory.
- Type the following:
- This command bootstraps the CLI and prevents unnecessary delays during the Eclipse configuration that follows.
zero version
- In Eclipse, click Window > Preferences > WebSphere sMash
- In the Zero home field, enter the path to your <zerohome> directory.
- The plug-in will take a few moments to search for the module groups from your CLI.
- After the Loading... message disappears from the Module group field, select the module group that you would like to use for application development. For more information about module groups, please search for the phrase "module group" in the Developer's Guide .
- Click OK to exit the Preferences dialog.
You are now ready to start developing WebSphere sMash application.
Creating and running an application
To create and then run a WebSphere sMash application, complete the following steps:
- Click File > New > Project ... .
- Expand WebSphere sMash category folder near the bottom and click the WebSphere sMash Application project type.
- Click Next > .
- Enter a name for your new application and click Finish to create it. Your new project is shown with a distinctive icon beside it.
- To run your new application, right-click the project and click Run As > WebSphere sMash Application . A message is displayed in the console indicating that the application was started on port 8080.
Note: All applications use port 8080 by default. If you have another application started, it cannot use the same port. The port is configured in the application'sconfig/zero.config
file. - Open a browser and enter
http://localhost:8080/
to see the default page of your application. It should look something like this: - Stop your application.
Congratulations! You have created and run your first WebSphere sMash application. Continue reading to find out how you can add additional dependencies to enhance your application. You can also look at the Employee Demo or Suggest Demo for coding examples.