
Plugins: The heart of Eclipse
The most important architectural characteristics of Eclipse is the plugin architecture. A plugin in Eclipse is a component that provides a certain type of service within the context of the Eclipse workbench. The Eclipse IDE itself is built with a number of plugins, which are dependent on each other, so that you can customize your development environment exactly for your needs.
Installing JBoss Tools plugins
JBoss plugins for Eclipse are part of the JBoss suite. You can find them in the JBoss Tools project, which is an umbrella project for all the JBoss developer plugins. JBoss Tools plugins can be downloaded from:
The installation of the JBoss tools can be performed in two ways—one is directly from your Eclipse IDE, the other choice (covered in the next section) is the manual installation of single plugin files.
So, once you have started Eclipse, move onto the last menu option Help, and select Install New Software (former releases of Eclipse name this menu option Software Updates). In the upper combo box, you need to select the repository for your Eclipse plugins. JBoss Tools is not installed by default, so you need to add a link to JBoss Tools trunk. The list of available update sites can be found at http://www.jboss.org/tools/download.
Once there, select the release that matches with your Eclipse distribution. For example, if you have downloaded the Eclipse 3.5 (Galileo) release, there's a development update available at http://download.jboss.org/jbosstools/updates/development/.
Once added, expand the JBoss Tools update site and you'll see the list of available plugins. For the purpose of this book, all you need is the JBoss AS plugin, the Hibernate plugin, and JBoss Tools RichFaces plugin.

Check them and click on the Next button, which will confirm your selections. Finish and wait for the time necessary to download the tools. Once the download is completed you will be prompted to restart Eclipse.
Installing JBoss Tools plugins manually
You can mimic the behavior of the Update Manager by installing the JBoss Tools plugins manually into your Eclipse installation.
The list of JBoss Tools plugins is available at http://www.jboss.org/tools/download.
Download the single JBoss AS plugin and Hibernate plugin zip files.
The structure of the single plugin's archive resembles the same structure of your Eclipse installation:
eclipse/ features/ plugins/
Once the download completes, you simply need to extract the plugins into the Eclipse installation directory.
For example, if you are using the command line and your Eclipse installation directory is named eclipse
, navigate to the directory above your Eclipse installation and extract the archive using the unzip
command.
unzip JBossTools-2.1.2.GA-ALL-linux-gtk.zip
Tip
Automatic versus manual installation
Automatic installation is the easiest solution because the wizard takes care to place all the necessary files in the right place, so we recommend it for developers who are approaching Eclipse with JBoss. However, manual setup is the preferred choice if you have to perform lots of installations for your developers because you can easily create a script that simply extracts the required files on multiple partitions. Manual installation is also the preferred choice when you need to change the plugin versions because switching from one release to another merely requires a file substitution.
If you are not too confident with shell commands, you might consider a third alternative of downloading the .zip
files containing the plugins, and pointing to the archive from the Software Updates menu as New Local Site.
We're almost done with the configuration. The last piece of the puzzle is connecting Eclipse with our installation of JBoss. Eclipse enterprise provides some out of the box facets to manage most application servers. However, we'll use the features of JBoss Perspective , which offers a richer set of options.
Therefore, the JBoss Perspective is a special view designed specifically for JBoss AS.
You can reach it from the menu. Select Window, then Open Perspective and Other. Select JBoss AS from the next menu.

Now a tiny little panel will appear in left-corner section of the screen. This panel holds the JBoss Server View. Right-click on it and select New | Server.

You'll be guided by an intuitive wizard that will at first ask you to select the Server's host name, the JBoss Community AS release, and the Runtime Environment.

In the next window, you will have to complete your server configuration by adding a JBoss Runtime.
What is a Runtime Environment ? Put it simply, it is a pointer to the JBoss server installation. It provides to Eclipse all classpath information that is required for each kind of project. It also communicates to the server’s components, all the necessary information to start and stop the server.
Basically, we need to choose a Name for our environment, point to the Home Directory where JBoss AS has been unpacked, and finally select the location where JDK/JRE has been installed.

Tip
More is better
It is a good idea to create several runtime environments if you are going to test your project across different configurations. Remember to give a meaningful description to your runtime environment. For example, it's better to have a "JBoss Development" and "JBoss Production" rather than "JBoss Runtime 1" and "JBoss Runtime 2"
Once you have completed the selections, click Finish and your new runtime will be added to the list and can now be targeted by a JBoss server. Right-click on your new server icon and verify that the application server starts correctly.