Servlets - SPLessons

Servlet Environment Setup

Home > Lesson > Chapter 3
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

Servlet Environment Setup

Servlet Environment Setup

shape Description

Servlet Environment Setup, Before start doing any project depending on Java, developer needs to install some tools on the system such as JDK, Eclipse, Tomcat. Java is a platform independent , Eclipse is an IDE on which developed projects will be executed, Tomcat is like a localhost server utilized to display the result in the browser. Following are the mandatory tools required to build an application.

Servlet Installations

JAVA Environment Setup

shape Introduction

Servlet Environment Setup, JAVA which is a combination of JDK and JRE.

shape Step-1

Initially, download JAVA by clicking the url - JAVA URL

shape Step-2

Click on JDK and JRE download buttons as shown in the figure.

shape Step-3

Now click on the checkbox "Accept the licence agreement" as shown below.

shape Step-4

Download the links as per the operating system in the computer. The process of downloading for Windows OS is shown below.

shape Step-5

Now open the downloaded link and click on Next as shown below. If needed one can change the destination folder and click on Next.

shape Step-6

Java is now installed and one need to set the classpath. To set the path,go to My Computer -> Advanced system settings -> Environment Variables -> New. Follow the below figure which shows step-by-step procedure. Name the variable  as "PATH" Variable value as "C:\Program Files\Java\jdk1.8.0_65\bin" (destination folder of java)

shape Step-7

To develop any Java program, user need a text editor like Notepad, Eclipse, NetBeans can be used. Eclipse IDE can be downloaded from  Eclipse Link 

Downloading Eclipse

shape Description

Servlet Environment Setup, Before downloading the Eclipse, pick up the target platform Linux/Mac/Windows and make sure that the machine has a Java run time environment already installed, use either a 32-bit or a 64-bit versions of Eclipse and must have a JRE/JDK source that matches i.e.

Eclipse for Java Development

shape Description

In order to use the Eclipse for Java Development download the Eclipse from the official website link given below. http://www.eclipse.org/ By clicking the link, a page appears with a download link for Eclipse as below, now click the Download button on the page in order to download the Eclipse for Java development. A page appears providing a list of Eclipse versions by clicking the download link button, select the preferred version and download the Eclipse by clicking on it as shown in the image below. It shows drop down box in the right corner of the download page to set the operating system on which eclipse is to be installed. Choose from drop down box either Windows, Linux and Mac. Eclipse is packaged as a zip file, so extract the zip file into preferred drive.

Installing Eclipse

shape Description

If the directory have a fairly long path, when the user unzip the downloaded files under windows can get errors about path names being too long. In order to avoid such errors make sure that the default download directory is fairly deep on the hard drive and first move this up fairly high on the hard drive before unzipping, and thereafter no errors about path names being exceeded. In order to install Eclipse, required a tool which can extract the contents of a zip file. The tools like PeaZip, IZArc, 7-zip can be used. Now, Right click on the downloaded Zip file and extract all the files to the preferred directory to be installed by clicking Extract. The image below display the Eclipse files folder extracted to the particular directory given.

Workspace - Launching Eclipse

shape Description

Immediately after lunching Eclipse, a window appears asking the drive to store the Workspace. A workspace is a collection of projects that are to be work with when launching Eclipse. A project can take any number of forms from a desktop executable, a library, a set of web pages, and more. If the client used to working with a product like Visual Studio, a workspace can be a little bit of an adjustment. Not all projects in a workspace have to be related and can take any approach that are like to creating a workspace. User can create a single workspace and create every programming project under that workspace. Eclipse is actually geared towards this approach. It has some additional tools like working sets, but working sets allow for convenient grouping to make it easy to work with a subset of the projects and can also create any number of workspaces. The work space can be set to default or changed to new folder location using the Workspaces Preference window as shown in the image below.

Apache Tomcat installation

shape Description

Tomacat is an open source environment, it was developed by Apache software foundation (ASF) used to implement java server page specifications and Tomcat will be used as a server while doing the projects with servlets and JSP. The installation Apache Tomcat shown as follows.

shape Step - 1

Click the Next button.

shape Step - 2

Click the Agree button.

shape Step - 3

Check the components and click the Next button.

shape Step -4

Enter user name and password.

shape Step - 5

Click the Next button.

shape Step - 6

Click Install to complete the installation.

shape Step - 7

Click the Finish button.

Summary

shape Key Points

  • Servlet Environment Setup - Apache Tomcat is used to deploy Servelet and JSP’S.
  • Tomcat server needs to configure with the Eclipse tool.
  • JDK also should configure with the Eclipse tool.