If you work for a large enterprise you undoubtedly know the “features” of typical IBM Rational products. And if you work at a really large enterprise you likely have little freedom for deployments environments beyond Websphere. But that’s OK! For the first post in our cross-blog series “Escaping IBM Rational Products” we look at alternatives to IBM’s Rational Application Developer - keeping in mind that the result must be a file that can be easily deployed to a Websphere server once ready for production. But we can avoid having to deal with WAS in development (mostly). …not that constant crashes and consistent use of several gigabytes of memory isn’t desirable - no wait, that’s extremely undesirable. We can also save the recurring license costs associated with Rational development tools.
First thing is first - IBM’s Rational Application Developer is built on the Eclipse Foundation’s Eclipse project.. so let’s start with a clean (and working) version of Eclipse for Java EE (formerly J2EE). You can download the latest version “Helios” from the foundation directly - FREE! Eclipse is a powerful but lightweight (compared to 4.7 Gigabytes, anything is lightweight..) IDE that is easily extended for various languages and platforms. We may suggest a folder dedicated to development applications. For these examples we will be using our company issues machines that use windows, so we create a new directory: C:\Apps Edit the security on the new folder and give yourself full permissions. This will allow you and eclipse to modify the files and launch servers as needed. Extract the entire Eclipse folder under your apps directory, the result should look similar to this:
[caption id=“attachment_781” align=“aligncenter” width=“186” caption=“Custom Development Directory”][/caption] (Don’t worry about the folders that are crossed out.. we’ll get there.) At this point you can make a shortcut of the eclipse.exe file found in the root and move it to your desktop/start menu/quick launch/etc.
Apacht Tomcat is a simple web application server that can handle JSPs and Servlets very well. It is also very well integrated to Eclipse by default. Hit the apache site and download the latest version (Version 6.x as of this writing). You’ll want to grab the “binary distribution” for whatever version you choose. Again you will just want to extract the entire package under your “apps” directory. (nope, no need to run or configure anything, just extract..)
Now that we have an application server, and IDE we can hook them together. Start by launching eclipse.exe, or the shortcut you made earlier. When you launch it you’ll see the new welcome screen in Helios: [caption id=“attachment_782” align=“aligncenter” width=“300” caption=“Eclipse Welcome Screen”][/caption] You can explore the new features, or click “Workbench” in the upper right to get to work! (do it..)
! You will need to do this to even code JEE applications! A JRE alone is not sufficient ! Once on the workbench, you should see the perspectives you’re familiar with from RAD.
Nice! now Eclipse will use Tomcat to launch web applications locally, but we still need to import the JEE Runtimes from tomcat.
By this point you have a base environment ready for new web applications and a local deployment server to host them. You can test it out by making a dead simple web app:
Your new project exists, but doesn’t do much, so we can add a simple HelloWorld servlet.
Now you should have a new servlet under the src directory. Make the code should look similar to this:
package servlets;
import java.io.IOException; import java.io.PrintWriter;
import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
/**
Servlet implementation class HelloWorld */ public class HelloWorld extends HttpServlet { private static final long serialVersionUID = 1L;
/**
/**
}
OK, now finally, finally we can launch it… Right-Click on the new servlet and choose Run As.. > Run on Server [caption id=“attachment_794” align=“aligncenter” width=“300” caption=“Running a Servlet”][/caption] In a few seconds you should be looking at the result:
The Rational Application Developer name and other respective trademarks are the property of IBM. The opinions expressed in this article are not endorsed by IBM or any other vendors .. they are just opinions.