|Home > Documentation > Developer's guide > Development environment|
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:
In this section we briefly discuss various tools available to set up a development environment.
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 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 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.
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.
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 (all of which is platform specific):
Sun JDK 5.0 can be downloaded from Sun's J2SE 5.0 Downloads site. The Eclipse IDE for Java EE Developers can be downloaded from the Eclipse Downloads site. Download and extract the Eclipse IDE for Java EE Developers archives to a directory of your choice (for e.g. C:\eclipse). The archive will be extracted to a directory named eclipse under the directory you specified (for e.g. C:\eclipse\eclipse), referred to as <eclipse_home> from now on. Make sure that the JDK in the PATH is Sun JDK 5.0. Launch Eclipse by running <eclipse_home>/eclipse.
The Geronimo server can be installed using the Geronimo Eclipse Plugin, or optionally you may install the manually. To install it manually, download the Geronimo 2.1.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.1 (for e.g. C:\g\geronimo-tomcat6-javaee5-2.1.1) or geronimo-jetty6-javaee5-2.1.1 depending on whether you downloaded Geronimo 2.1.1 distribution with Tomcat or Jetty as the web container. We will refer to this directory as <geronimo_home> from now on.
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.
Maven Integration for Eclipse provides tight integration for Maven into the IDE and providing the following features:
For more details and installation instructions, visit http://m2eclipse.codehaus.org/.
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.
In order to define a new Geronimo Server v2.1 Runtime, follow the steps below:
The directory specified for Application Server Installation Directory must exist in order to select Download Options.
Additional Server Runtimes to use a different Geronimo server installation or a different JRE can be added in a similar manner.
Follow the steps below to define a new Geronimo v2.1 Server:
|Additional Geronimo Server Runtimes can be installed by clicking on Installed Runtimes button and return to this step once done to select the newly added server runtime.|
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.
|A Geronimo Server can also be defined while creating a Geronimo Server Runtime by checking the option Also create new local server. This will present an additional dialog to configure the hostname, ports, etc.|
Once Geronimo Server Runtimes are defined, Eclipse provides these runtime for selecting as a target runtime while creating an EJB, Web and Java EE projects. Notice the Target Runtime field in the Dynamic Web Project dialog shown in the figure below.
Upon adding the Geronimo 2.1 Server Runtime as the target runtime, the Geronimo server libraries and Java EE specification libraries get automatically added to the build path of the project. GEP will also create Geronimo specific deployment plans.
In order to run an application on Geronimo, follow the steps below:
The application can also be run on Geronimo by adding the project to the Geronimo server explicitly as given below:
In this section we discuss various options to configure your development environment.
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.