Servlet Configuration  «Prev  Next»

Lesson 4A text editor to edit Java
Objective Choose the text editor you will use for code.

Text Editor for editing Java Servlets

When you learned the Java language, you probably used the JDK, the Java Development Kit. It comes with a number of useful tools, such as a compiler and the AppletViewer. But it does not include a text editor of any kind. Use an open source editor such as Eclipse, since this editor offers the following benefits.
The Eclipse IDE runs on a Java VM and only requires a jre. However, if you plan on developing Java applications, you probably want a JDK (Oracle supplies both. The licensing is different and they have different tool sets)
In this course we are assuming you are using the JDK. Download the open source IDE known as Eclipse from
You can use this editor, or NetBeans netbeans , or IntelliJ, etc. Eclipse runs on Linux and Mac as well, so you do not have to settle for vi or emacs. You may have a specific editor you prefer.
If you are using Notepad, you might be surprised to know that you can launch it from an MS-DOS prompt. Say you were writing an applet called, you have just compiled your code, and found some errors. You could type this line:

Notepad will be launched, and will open your file for you. This can be a real timesaver.

Text Editor- Exercise

Click on the link below to go to the Compile a servlet exercise.
Text Editor - Exercise


Because servlets are written in Java and conform to a well-defined and widely accepted API, they are highly portable across operating systems and across server implementations. You can develop a servlet on a Windows machine running Tomcat 7 or later deploy it effortlessly on a high-end Unix server running Websphere. With servlets, you can truly write once, serve everywhere. Servlet portability is not the stumbling block it so often is with applets, for two reasons.
  1. First, servlet portability is not mandatory. Unlike applets, which have to be tested on all possible client platforms, servlets have to work only on the server machines that you are using for development and deployment. Unless you are in the business of selling your servlets, you do not have to worry about complete portability.
  2. Second, servlets avoid the most error-prone and inconsistently implemented portion of the Java language: the Abstract Windowing Toolkit (AWT) that forms the basis of Java graphical user interfaces.

In the next lesson learn how to use the JSDK server.