| | |
|
|
|
Installing and configuring: Eclipse for Java and Groovy
Eclipse is an open development platform developed by an open community. It includes extensible frameworks, tools and runtimes for building, deploying and managing software across the life cycle. The following sections of this article provide information about installing and configuring Eclipse for Java and Groovy:
Prerequisites
If you choose to develop with Eclipse, the following prerequisites are required:
Installation
To use this platform, follow these installation steps:
- If you do not already have Eclipse 3.2 (or later) installed go to http://www.eclipse.org to download and install it.
- The Project Zero plug-in also requires a version 1.5/5.0 (or later) JDK. The
bin directory of the 1.5 JDK must be referenced in your PATH environment variable (appearing before any other Java installation). If you do not want to include the 1.5 JDK in your path, then you can start eclipse with a VM argument as shown in the following example:
eclipse -vm <path_to_your_JDK>\bin\javaw
Note: Use / for UNIX-based file systems.
- To verify that the correct version of Java is in your
PATH, type java -version.
- Start Eclipse and click Window > Open Perspective > Java to change to the Java perspective.
- To configure the update sites in Eclipse do the following:
- Click Help > Software Updates > Find and Install ...
- Select Search for new features to install and click Next >.
- Click New Remote Site ....
- Enter a name like Project Zero Update Site and enter the following URL: http://www.projectzero.org/update/zero.eclipse.latest
- Click Finish.
- To install the Eclipse plug-in, do the following:
- Select the name of the remote site you added (Project Zero Update Site or the name you gave it) and click Next >.
- Read and accept the license agreements and click Next >.
- Click OK.
- Click Finish.
- Accept the license agreement.
- Install all of the options and then click Yes when asked to restart Eclipse.
Creating and running an application
To create and then run a Project Zero application, use the following steps:
- Click File > New > Project ....
- Expand the Project Zero category folder near the bottom and click the Project Zero 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 Project Zero icon beside it.
- To run your new application, right-click the project and click Run As > Project Zero Application. This launches the application. A message will be displayed in the console indicating that the application was started on port 8080.
- In a browser go to
http://localhost:8080/ to see the default page of your application. It should look something like this:

- To see some details of the request, go to
http://localhost:8080/zero/webtools/snoop.gt. It will give you a response like this:

- Stop your application.
Congratulations! You have created and run your first Project Zero application. Read on to find out how you can add additional libraries to enhance your application. You can also create a sample application with the To do list Part I - Simple to do tutorial.
Resolving libraries
Under your project there are three containers, a JRE container and two Zero library containers. The Zero library containers are:
- Zero Local Libraries
- Adds all of the JAR and ZIP files from the
/lib directory to your classpath.
- Zero Resolved Libraries
- Resolves libraries from configured repositories and adds them to your
classpath. This container uses an ivy.xml file located in the config directory to resolve dependencies from repositories and adds the resolved JAR and ZIP files to your classpath.
You can add JAR files to the project classpath by copying them into the lib directory of the project, or by adding dependencies from repositories. When a project is first created, it only has two dependencies: zero.core and zero.core.webtools.
A library can be pulled from a repository. The following steps show how this is done by editing the dependency configuration to add the zero.data library to the project:
- Double-click the config/ivy.xml file in your project to open the Zero Package Editor as shown below:
2. Click the Add... button in the Dependencies section of the editor. The Dependency Selection dialog that displays allows you to select a dependency from the local repository which was installed with the Eclipse plug-in as shown below:
3. If your local repository does not already contain the dependency that you need, as is the case here, click the Manage Repository button to find the dependency in a remote repository. This opens a new dialog like the following example:
4. Enter zero.data in the Module field and click Search to find the zero.data library. After finding it, select it and click Download to add the zero.data library to your local repository and click Close to exit the Manage Repository dialog.
3. Now, from the Dependency Selection dialog select zero:zero.data(1.0+) from the list and click OK. The dependency has been added to the list.
4. Click Ctrl-S or File > Save to save the modified package information.
5. To see the zero.data library added to your classpath as shown below, expand the Zero Resolved Libraries container under your project.
6. If the library is not currently located in a repository, then you can add a library to the Zero Local Libraries container. To do this, drag and drop a JAR file into the /lib directory of your project. This triggers the Zero Local Libraries container to refresh and add the library to your classpath. You can expand the Zero Local Libraries container to see the JAR file.
If you installed all of the plug-ins (including the samples plug-in) from the Project Zero site, you can create example Zero projects in your workspace.
- Click File->New->Example....
- If you have multiple Example types, expand Zero Examples.
- Select Project Zero Example Projects and click Next >.
- Choose one or more examples to create as projects in your Workspace and click Finish.
See the Tutorials and Examples pages for more information on using the tutorials and examples.
Enabling logging for the event core
To enable logging for the event core, use the following steps:
- Edit the
logging.properties file in your installation directory under the config/logging.properties directory.
- To log all messages for the event engine, add the following line to the
logging.properties file: zero.core.events.EventEngine.level=FINEST
- Right click the logs folder and click Refresh.
Exporting applications
To export your application, use the following steps:
- Right-click the project and click Export....
- Expand the Project Zero category.
- Select Project Zero Export Wizard and click Next.
- Click Browse... to select a directory and store the exported zip file.
- Check Include Source to include the source project.
- Click Finish to export the project.
Note: you must include source if you plan to import the project back into Eclipse.
Importing applications
To import a zero application that has the source included (see above), use the following steps:
- Click File > Import > General > Existing Projects into Workspace.
- Click Next.
- Select the Select Archive File radio button.
- Select Browse... to locate your exported zero zip file (for a project that is not already in your workspace) and click 0K.
- Click Finish to import the checked project.
|
|
r38 - 23 Jan 2008 - 22:00:35 - paynel
|
|
|
| | |