Just Code it!

For this post I continue from where I left after installing JBoss in a previous article (Install JBoss and use it in Eclipse (Juno)). This is not a must though and it works in isolation, so you don’t need to look at the other one if you don’t need to.

Enough said, let’s start.


Tomcat– Downloading

Go to the  Tomcat website download page and scroll down where you can see the binaries ready to be downloaded:


I will downloaded the zip of the version 7.0.40:


Once the download completes, unzip its content in a reasonable location. I put mine in “C:\apache-tomcat-7.0.40″


 Tomcat – Configure Windows

In order to been able to launch Tomcat in isolation, you need to configure at least one environment variable.

So let’s do this.

Open the computer properties. You can do this opening the Start menu and right-clicking on the “Computer” button and selecting “Properties”:

In the new window click on the Advanced system settings link in the right panel:

In the System Properties window select the “Advanced” tab and click the “Environment Variables…” button:

In the new window click “New…” below the “User variables” section (or you can use the System variable if you want this to be set for everyone):

A new window will pop-up and here you will have to add a variable “JAVA_HOME” that points to your data sdk:

Press Ok and Ok again in the previous window and it will be ready.


Tomcat – Test it

To test that everything is correctly configured let’s just do a quick test run.

Go where it is located and enter in the bin folder: C:\apache-tomcat-7.0.40\bin

Double click the “startup.bat” batch file. If windows asks you confirmation to trust the file click OK (deselect the checkbox “Always ask before opening this file” if you don’t want to see this popup every time you launch it).

You should see a console window coming up and stay on screen:

To see Tomcat at work now, open a browser and go to:


You should see something similar to this:

When you are happy you can then shut it down executing “shutdown.bat” from the same bin folder.

The console window should disappear and we can move to the next step :)


Tomcat – Adding the server to Eclipse

Open Eclipse and open the “Servers” tab. If you have trouble finding it, use the same steps explained in another post: Install JBoss and use it in Eclipse (Juno)

Once you find it:

Add a new server (right-click menu):

In the new window select the Apache folder and select the Tomcat version that you installed. It is the 7.0 in this case:

If this is the screen that you see then the only thing you can do is click Next.

If you end up in a workspace where tomcat was already configured, the chances are that you will see another screen that will allow you to jump directly to the completion of the task, just clicking on Finish:

In any case, if you didn’t see this screen and what you see is the previous one, then click Next and you will be prompted to insert some info that eclipse needs in order to been able to interact with the server. Note that this screen is the same one you would see if you click on “Add…” on the other screen I just shown above.

Here make sure you enter the path where you extracted the Tomcat zip file.

Before proceeding, ensure you select the JRE you want to use. In my case I already configured eclipse to use the Java EE SDK, so it is ok in this case just leave the option set to “Workbench default JRE”.

After clicking on Finish you will see the Tomcat server displayed in the servers tab:

Job done!


Thanks for following and stay tuned for the next episode.

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:
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 ;)

That’s the second part to the series that shows how get the system ready to develop RESTful services with Java EE, Tomcat 7.0, JBoss or GoldFish.

You can find the previous post here: Installing Java EE SDK and GlassFish

This section will focus on installing Eclipse (Juno) and set up its jre path.


Eclipse Juno – Download

The first thing to do is of course reaching the eclipse website and specifically the download page:

and download the Eclipse IDE for Java EE:

You will probably want to download the 32bit version, unless you know and you want to use a 64bit.


Eclipse Juno – Install

There is not really much to install here…

Just extract the package (I would suggest to extract its content in the root folder of you HD. Ex: “C:\eclipse”).


Eclipse Juno – Run

Once extracted enter in the folder and run “eclipse.exe”:

Once launched it will ask you to select your work folder. You can leave the default settings here


Eclipse Juno – Configure

Now we need to configure it in order to use the Java EE SDK we just downloaded.

Open the Window->Preferences menu option:

In the Dialog that will pop up, type “jre” or drill down in Java->Installed JREs section, select it and click on the “Add…” button:

In the new window just click Next (with Standard VM select):

In the next window enter the path where your glassfish is installed, making sure that the “jdk” sub-folder is included in the path, or navigate to its location using the “Directory…” button.
The JRE name and system libraries should be automatically filled by the system.
Once everything looks ok, just click on finish:

You will be back at the jre selection windows.

Make sure to select the newly added JDK this time:

and you are good to go!


In the next post I’ll show hot to install and connect Eclipse to some of the available servers. Stay tuned!


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