| | |
|
|
|
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 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 like:
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, close the welcome screen, 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 a URL. The URL should be: http://www.projectzero.org/update/zero.eclipse.latest
- Click Finish.
- To install the Eclipse plugin, do the following:
- Select the Project Zero Update Site (or whatever you named 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.
Getting started
- Click File > New > Project ....
- Expand the 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 Zero icon next to 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 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:

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

Congratulations! You've created and run your first Zero application. Now, read on to find out how you can add additional libraries to enhance your application. You can also create a sample application with the Todo list 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 will opena new dialog like the one shown below:
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.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.
Using Zero examples
If you installed the Zero Examples plugin from the Project Zero Downloads 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 [[TutorialsExamples][Tutorials] and Examples pages for more information on using the tutorials and examples.
Enable logging for the event core
- Edit the
logging.properties file in your installation directory under the config/logging.properties directory.
- To log all messages for the event engine, add this line:
zero.core.events.EventEngine.level=FINEST
- Right click on 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 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, then 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.
|
|
r30 - 04 Sep 2007 - 19:39:10 - ajtarter
|
|
|
| | |