Just Code it!

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!


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!


That’s is the first of a set of few posts that will focus in installing and configuring Eclipse in order to been able to build Dynamic Web Pages with Java EE SDK using Tomcat 7.0, JBoss or GlassFish.

In this first post I’ll focus only in the initial step of downloading and configuring Java EE and Eclipse (Juno).


Java EE SDK – Download

The first thing to do is going to the Java download page:

and select the “Java Platform, Enterprise Edition 6 SDK Update 4 (with JDK 7u11)” or newer version:

Or directly go to the download page (if that’s the latest version):

Here just accept the license agreement:

and download the file you need.

If you are in windows you will probably need the “Windows” (or “Windows – Multi-Language”) version for a normal Windows 32bit version. If your system is 64bit, then you can decide to go for the x64 versions.

Java EE SDK and GlassFish – Install

When the download is completed, run it and simply follow the instructions, they are quite straightforward.

Some key points are:

  • You will want probably to select: “Typical installation
  • Leave the installation directory to the default one: “C:\glassfish3
  • Leave the Install and Enable Update Tool options checked as they are (with no proxy settings)
  • Leave it create the default domain (domain1) using a sensible username (“admin”… if it is sensible :)) and possibly a more meaningful password
  • If you are prompted by Windows Firewall about allowing access… allow it

Once finished you should be able to go to “localhost:8080” and see the glassfish default page:


That’s really it for it. The next Post will be dedicate to Installing and configuring Eclipse (Juno).

You can find it here:

Installing Eclipse (Juno) and configure it with Java EE SDK