You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 17 Next »

An integrated development environment (IDE) provides facilities for software development and typically consists of editors for editing source code, a compiler, project management tools, build automation tools and debugging tools. IDEs help in increasing the productivity by automating many tasks and often provide one-step process for creating a ready to use binary from source code. Eclipse and NetBeans are two of the most popular IDEs. IDEs that enable Java EE development also provide integration of Java EE Server runtime environments so that the developer can quickly see the effect of the changes being made to the application without having to create the binaries explicitly.

The Apache Geronimo Development Tools project is aimed at providing a rich set of development tools for Geronimo, focusing on application development, migration and IDE integration. The two major tools available currently are Geronimo Eclipse Plugin (GEP) and JBoss to Geronimo Migration Tool (J2G). Also, a Geronimo NetBeans Plugin is under development in Geronimo Sandbox. This article on setting up a development environment is organized as given below:

Options and tools

In this section we briefly discuss various tools available to set up a development environment.

Eclipse

Eclipse is an open source IDE for Java developers and consists of Java Development Tools. Eclipse is written primarily in Java. Eclipse community is focused on building an open development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle. Users can extend its functionality by installing plugins written for Eclipse. For more details visit Eclipse web site.

NetBeans

NetBeans is an open source IDE written entirely in Java using the NetBeans platform. NetBeans IDE provides all the tools needed for creating desktop, enterprise web and mobile applications in Java. For more details visit NetBeans web site.

Apache Maven

Apache Maven is a Java tool for software project management and automation for Java. It uses project object model to describe the software project being built, its dependencies on other external modules and components, and the build order. It comes with pre-defined targets for performing certain well defined tasks such as compilation of code and its packaging. Maven consists of a core engine which provides basic project-processing capabilities and build-process management, and a host of plugins which are used to execute the actual build tasks. Maven is primarily a command-line tool. Plugins to integrate Maven with Eclipse and NetBeans IDEs are also available. For more details visit Apache Maven web site.

Web Tools Platform (WTP)

The Eclipse Web Tools Platform (WTP) project extends the Eclipse platform with tools for developing Web and Java EE applications. It includes source and graphical editors for a variety of languages, wizards and built-in applications to simplify development, and tools and APIs to support deploying, running, and testing applications. For more details visit WTP Project web site.

Geronimo Eclipse Plugin

The Geronimo Eclipse Plugin (GEP) provides integration between Geronimo and the Web Tools Platform (WTP). With this plugin, users will be able to use the features in WTP to create, deploy and debug applications on Geronimo.

The Geronimo Eclipse Plugin (GEP) requires the following prerequisite software (Note: Update the list once GEP 2.1 is released).

  • Sun JDK 5.0 (J2SE 5.0)
  • Eclipse 3.3.1.1 (Eclipse Classic package of Europa distribution), which is platform specific
  • Web Tools Platform (WTP) 2.0.1
  • Data Tools Platform (DTP) 1.5.1
  • Eclipse Modeling Framework (EMF) 2.3.1
  • Graphical Editing Framework (GEF) 3.3.1

Sun JDK 5.0 can be downloaded from Sun's J2SE 5.0 Downloads site. WTP and all the other prerequisites can be downloaded from WTP Downloads site.

Geronimo server can be installed from within Geronimo Eclipse Plugin. This feature does not work currently for 2.1 server. Download Geronimo 2.1 server from http://www.apache.org/dist/geronimo/ and extract the archive to a directory of your choice (for e.g. C:\g). The archive will be extracted to a directory geronimo-tomcat6-javaee5-2.1 (for e.g. C:\g\geronimo-tomcat6-javaee5-2.1) or geronimo-jetty6-javaee5-2.1 depending on whether you downloaded Geronimo 2.1 distribution with Tomcat or Jetty as the web container. We will refer to this directory as <geronimo_home> from now on.

JBoss to Geronimo Migration Tool (J2G)

The JBoss to Geronimo Migration Tool (J2G) is an Eclipse plugin designed to assist in migrating the sources of an application written for the JBoss application server or written for Java Enterprise Edition (Java EE) to the Apache Geronimo platform. For more information on using the J2G tool follow this link. (Note: Need to link to the J2G usage page)

Installing Eclipse

The prerequisite software for GEP can be downloaded either as a single download or individual downloads. In this section we discuss the various options available to install the prerequisite software.

WTP All-in-One package

WTP along with all the other prerequisites can be downloaded in one combined bundle from WTP Downloads site. Download WTP All-In-One Package specific to your platform from v2.0.1 of WTP. Extract the archive to a directory of your choice (for e.g. C:\wtp). The archive will be extracted to a directory named eclipse under the directory you specified (for e.g. C:\wtp\eclipse), referred to as <eclipse_home> from now on. This completes the installation of eclipse.

Eclipse and WTP downloaded separately

Alternatively you can download Eclipse and WTP separately and install the prerequisites using the following steps:

  1. Download Eclipse 3.3.1.1 from http://www.eclipse.org/downloads/.
  2. Extract the archive to a directory of your choice (for e.g. C:\wtp). The archive will be extracted to a directory named eclipse under the directory you specified (for e.g. C:\wtp\eclipse), referred to as <eclipse_home> from now on.
  3. In WTP Downloads site, follow the link corresponding to v2.0.1 of WTP.
  4. Download each of the prerequisites DTP, EMF and GEF and extract the archives to <eclipse_home>.
  5. Download the wtp-sdk package listed under Web Tools Platform Complete and extract the archive to <eclipse_home>

Launch Eclipse by running <eclipse_home>/eclipse. Make sure that the JDK in the PATH is Sun JDK 5.0.

Installing Geronimo Eclipse Plugin

The Geronimo Eclipse Plugin (GEP) can be installed using the following options:

  1. Using WTP
  2. Using Eclipse Update Manager
  3. Manual Installation

#1. Install GEP Using WTP

The GEP can be installed directly from within WTP while defining a server runtime. Follow the steps below to install GEP:

  1. Launch Eclipse by running <eclipse_home>/eclipse.
  2. Launch the Define a New Server dialog using one of the following:
    • From the Servers view in the Java EE Perspective: Right-click, New, Server.
    • From any Perspective: Select File, New, Other, Server



  3. Click on the Download additional server adapters link.



  4. In the Install New Server Adapter dialog, select Geronimo v2.1 Server Adapter and click Next.
  5. Read and accept any License Agreements and click Finish. Click OK to continue installation.

This will download and install the GEP. The Progress view will display the installation status. Once the installation is completed, restart Eclipse. Define a New Server dialog will now show an Apache Geronimo v2.1 Server option under Apache.



#2. Install GEP Using Eclipse Update Manager

The GEP can also be installed via the Eclipse Update manager by creating a new remote site pointing to http://www.apache.org/dist/geronimo/eclipse/updates/. Follow the steps below to install GEP:

  1. Launch Eclipse by running <eclipse_home>/eclipse.
  2. Open the Eclipse Update Manager as follows:
    • Select Help, Software Updates, Find and Install.
    • Select Search for new features to install and click Next.



  3. Create a Eclipse Remote Update Site as follows:
  4. Select only the Geronimo Eclipse Update Site in the Sites to include in search selection box and click Finish.
  5. Select a mirror and click OK if prompted to do so.

(Note: Add more instructions once GEP for 2.1 is released. Currently the Geronimo Eclipse Update site does not host GEP v2.1)

#3. Manual Installation of GEP

Download the GEP 2.1 from http://www.apache.org/dist/geronimo/eclipse/. Close Eclipse if it is already running. Extract the archive to <eclipse_home>. Launch Eclipse by running <eclipse_home>/eclipse.

Geronimo Server Runtimes and Servers

A Geronimo Server Runtime in GEP associates a Geronimo 2.1 Server installation with a JRE to be used to run that server. A Geronimo Server in GEP associates a Geronimo Server Runtime with a profile consisting of Security settings, Publish Settings, Port Configuration, Java VM settings to be used with that Geronimo Server Runtime.

Defining a Geronimo Server Runtime

In order to define a new Geronimo Server v2.1 Runtime, follow the steps below:

  1. Click Window, Preferences, Server, Installed Runtimes.



  2. Click Add to launch New Server Runtime dialog.
  3. Select Apache Geronimo v2.1 Runtime, uncheck Also create new local server (we will discuss about the use of this option later) and click Next.



  4. Select Workbench default JRE (click Installed JREs to add any new JREs and return to this dialog once done), enter the directory name or browse to <geronimo_home> and click Next. (Note: Download options part of this dialog does not work currently.)



  5. Select the location of the archive containing Geronimo source. This is required only if you intend to debug into Geronimo source code.
  6. Click Finish to return to Installed Server Runtime Environments dialog.



Additional Server Runtimes to use a different Geronimo server installation or a different JRE can be added in a similar manner.

Defining a Geronimo Server

Follow the steps below to define a new Geronimo v2.1 Server:

  1. Launch the Define a New Server dialog using one of the following:
    • From the Servers view in the Java EE Perspective: Right-click, New, Server.
    • From any Perspective: Select File, New, Other, Server.



  2. Select Apache Geronimo v2.1 Server, select an Apache Geronimo v2.1 Runtime from the Server runtime dropdown and click Next.



  3. Modify Hostname, Administrator Id, Administrator password, Web Connector port and RMI Naming port if necessary and click Finish. Normally you will not need to change the default values for these fields for a newly installed Geronimo 2.1 server.



This completes defining a new Geronimo 2.1 Server. The newly added server will appear in the Servers view. The server can be started by selecting the server and clicking on the Start server button.



Creating a new project

To create a new Web project, follow the steps below:

  1. Click File, New, Project to launch the New Project dialog.
  2. Select Dynamic Web Project and click Next.



  3. Enter mywebapp for project name, select Apache Geronimo v2.1 Runtime for Target Runtime, select Default Configuration for Apache Geronimo v2.1 Runtime and click Finish.



  4. In the Project Explorer view, Right click on mywebapp and select New, JSP.
  5. Enter index.jsp for File name and click Finish.
  6. Change the content of index.jsp to the following:
    index.jsp
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>My WebApp</title>
    </head>
    <body>
    <h1>Welcome to My WebApp</h1>
    </body>
    </html>
    
  7. Right-click on mywebapp and select Run As, Run on Server.
  8. Click Choose and existing server, select Apache Geronimo v2.1 Server at localhost and click Finish.

The application will be run on the selected server and the welcome page will display in a web browser window inside eclipse.

Configuring your development environment

Editing a Server configuration

In order to edit the configuration of a server, double click on server in the Servers view to open the overview of the server as shown below.



  • Security Credentials
    The default User ID is system with a password manager. If your server installation uses a different set of credentials, change these accordingly.
  • Automatic Publishing
    All servers use the default publishing settings. The server can be configured to not publish automatically by selecting the Never publish automatically option. The default publish setting can be overridden by selecting the Override default settings option and providing a new Publish interval.
  • Port Configuration
    The default HTTP and RMI ports are 8080 and 1099 respectively. If your server installation uses a different HTTP and/or RMI port, edit these values accordingly.
  • Console Output
    The default server console output log level is INFO. If you want to enable debug output to console, select DEBUG.
  • Server Startup
    The settings under this section control the ping thread that polls to the server while the server is starting up. (Need to figure the exact use of these setting)
  • Server VM Arguments
    Any additional arguments to be passed on to the server VM can be specified here.
  • No labels