Just Code it!
Header

That post is exactly what the title says. We’ll install JBoss and configure the server in Eclipse.

From a chronological order, this post comes after:

And after or as an alternative to:

but I will assume that this is the first server you’ll configure in Eclipse.

 

JBoss – Downloading

Well, easy enough… just go to the website:
http://www.jboss.org/jbossas/downloads/
and download the version you want to use.

I’ll assume you will download the version 7.1.1  (zip):

 

JBoss – Installation

Just unzip the file in your preferred location. I’ll suggest to put it in the root of your HD. Ex: “C:\jboss-as-7.1.1.Final“.

That’s all… really!

 

JBoss – Configure Eclipse (JBoss Developer Studio)

Open Eclipse and navigate to Help->Eclipse Marketplace…:

In the windows that will pop up enter “jboss” in the search field and enter it.
The JBoss Development Studio should be easily visible.
When you spot it, just click on the Install button:

And just confirm it with Next:

Then finish it accepting the terms and clicking on Finish:

The installation will start…

You will be prompted to continue with the installation. Simply click on OK:

At the end of the Installation Eclipse will ask you to restart itself. Accept it.

When the restart will be complete JBoss Dev Studio will ask you to send them usage statistics.
Feel free to select any of the two options based on your personal preferences.

Now you can have access to the new JBoss Dev Studio Perspective!
Open Window->Open Perspective->Other…
Unless you can directly see it listed in the perspectives:

Then select JBoss in the new Pop up:

Now it’s done! And you can switch to the new perspective simply clicking on the JBoss button that you can see in the top right area of your screen:

This perspective is very useful especially because presents to you a nice portal that you can use to quickly start projects and documentation/examples.

 

JBoss – Adding the server to Eclipse

Click on the “Servers” tab that you should have visible in the bottom area of your screen:

You should see the other servers listed (if any) or a link that prompt you to add one server:

You can click on the link (if you see it) or right click in the white area and select the New->Server option:

In the new window select the JBoss server you intend to use. I’ll install the JBoss AS 7.1:

In the next window you will have to enter the path where you unzipped JBoss and make sure to select the correct JRE (the Java EE SDK we downloaded in another blog post):

You can the simply click on Finish (or continue with a couple of Next if you prefer).

After this you will see you server listed in the Servers tab:

Job done!

 

That’s all for this episode.

We’ll install more servers (just for fun) in other posts and will see how to write a Servlet to use with them. Stay tuned ;)

This post continues from we were after the posts:

 

GlassFish Server – Installing the Tools in Eclipse

After the setup of Eclipse and the JDK, within Eclipse open the marketplace:

And search “glassfish”. Those are the results you should see coming up:

You will have to click on the Install button for the GlassFish Tools for Juno (see picture above).

A confirmation window will popup with the options selected. I’ll leave all of them enabled and click Next:

Then of course accept the agreement and click Finish:

Then be patient while the installation takes place…

At the end you will be prompted to restart eclipse. Do it.

Once restarted, let’s add a new GlassFish Server.

 

GlassFish Server – Adding a reference in Eclipse

In order to do so switch to the Server tab (visible in the lower area of the IDE):

If you can’t see this tab for any obscure reason, you can still access to ti through the menu: Window->Show View->Servers:

If you don’t see this option neither, then click on the “Other…” option in the same menu list ( Window->Show View->Other…) and in the search window type “servers” or look in the Server section. Select the “Servers” component and click OK:

In this window you should see a link to “new server wizard…” if you don’t have any server configured:

Otherwise (or anyway in any case) you can right-click in the server window and select New->Server:

The server wizard window should come up.

Select one of the GlassFish options. I’ll select the version 3.1.2. Click Next once selected:

In the next window you will have to provide eclipse with the information about the location of your glassfish installation (where you extracted it) and the JRE to use.

By default it will suggest the default ones, but I selected the jdk7 this time.

Click Next once finished. Note that the folder must be the glassfish one and not the parent folder (see picture). Eclipse will help you if you select the wrong folder anyway.

Nothing much left to do here, except inserting the correct admin name and password and click Finish.

Note that if you click Next, you will have the possibility to associate immediately some projects with this server, but I don’t have any project that I want to associate in this moment.

At this point the server should be visible in the Servers Tab:

 

GlassFish Server – Starting it in Eclipse

If you double click on it you will see a nice window that will show you some of the options you have access to:

Another nice thing we can explore at this point is the server admin panel as well.

In order to do so we need first to start the server.

One way of doing this is selecting our glassfish server in the servers tab, and clicking on the big green play button on the right (or pressing Ctrl + Alt + R as visible in the tooltip):

An alternative way is rigth-click on the server itself and selecting the Start from here:

The Console should get focus automatically and if everything is as it should, then you should see some nice logs to communicate that everything worked as expected.

If not, and you see something like this:

Or even this:

Then open again the option window (double click on glassfish) and modify one of the connection options.

Untick the “Use Anonymous Connection for Admin Commands” option and of course make sure that the username and password are the correct one.

Save the change (or simply close the window and save when prompted) and retry to start the server.

Wait of course for the indicator in the lower right corner to complete:

And this time if this time everything goes fine the servers tab should now show that our glassfish instance is started (and synchronized):

 

GlassFish Server – Interacting with it with the Admin Console

A nice thing to explore now is the glassfish admin console (on the running server).

You can do this directly in eclipse, right-clicking on the glassfish server and navigating to the option GlassFish->View Admin Console:

A new window should open in the eclipse IDE and should connect to the glassfish home url (localhost:4848 in my case):

From here, inserting the correct credentials and logging in, you will have access to your admin console in all ts wonder!

Well…

That’s it for now. You can enjoy to explore the numerous options here and I’ll continue the tutorial with the creation of a servlet to run on this (and other) servers in another post.

 

Thanks for tuning and see you next time!