Getting Started with Java Web Development in Eclipse and Tomcat
This is the first part of a series of Java Web development tutorials. It is intended to warm you up by introducing two fundamental Java web components, JSP and Servlet, and helping you prepare your development and deployment environments for the next steps.
Select J2SE v 1.4.2_14 SDK instead of J2SE v 1.4.2_14 JRE, and click on "Download J2SE SDK."
On the next page accept "License Agreement" and download j2sdk-1_4_2_14-windows-i586-p.exe.
After it finishes, double click on your saved downloading and do full installation.
Install the Eclipse IDE on Windows Workstation
Here is what Eclipse websites tell you:
Eclipse is an open source community, whose projects are focused on building an extensible development platform, runtime and application framework for building, deploying and managing software across the entire software lifecycle. Many people know us, and hopefully love us, as a Java IDE but Eclipse is much more than a Java IDE.
The Eclipse open source community has over 60 open source projects. These projects can be conceptually organized into seven different "pillars" or categories:
Enterprise Development
Embedded and Device Development
Rich Client Platform
Rich Internet Applications
Application Frameworks
Application Lifecycle Management (ALM)
Service Oriented Architecture (SOA)
Eclipse is a popular, open source, and free development environment. It has everything you need to develop enterprise applications, including an IDE, Integrated Test Environments (such as Generic J2EE, Tomcat, Weblogic, and Websphere, etc.), building and deploying tools.
We'll use the Eclipse's all-in-one version. It bundled with Core Eclipse 3.2.2, Eclipse Web Tools Platform (WTP) 1.5.3, and other prerequisites so you don't have to download and install each part separately.
Installation is extremely simple - just unzip the file into the designated directory, for example, you C driver, you'll get C:eclipse and you are ready to go.
Besides installation, we won't go into detail for this tutorial. Here is a brief introduction:
Apache Tomcat is the Servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
Apache Tomcat is developed in an open and participatory environment and released under the Apache Software License. Apache Tomcat is intended to be a collaboration of the best-of-breed developers from around the world. We invite you to participate in this open development project. To learn more about getting involved, click here.
Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations. Some of these users and their stories are listed on the PoweredBy wiki page.
You probably will ask why we need to install JDK 1.4.2, since we install bundled Eclipse and it's already bundled with supported JDK. The reason is that we are going to develop and test our JSP or Servlet in the integrated Eclipse environment so no additional dependencies are required. In the following tutorials, we'll also export them from Eclipse and deploy them to the Tomcat server. Before JSP or Servlets can run in Tomcat, they have to be compiled, so JDK instead of JRE is required. Tomcat 5 has been extensively tested with JDK 1.3.1 and JDK 1.4.2
Installation is another easy task. Unzip jakarta-tomcat-5.0.28.zip to your target location, say, you hard drive C. You'll get C:jakarta-tomcat-5.0.28.
Now we need to set up two environment variables: CATALINA_HOME and JAVA_HOME. I'm sure you have done this before. The screenshot is my laptop's environment variable setting:
Up to now, you should have following installations:
C:j2sdk1.4.2_XX (mine is C:j2sdk1.4.2_12) C:eclipse C:jakarta-tomcat-5.0.28