Java Reference
In-Depth Information
Using a Text Editor
Unlike more sophisticated Java development tools, the Java Development Kit does not
include a text editor to use when you create source files.
A
For an editor or word processor to work with the kit, it must be able to save text files
with no formatting.
This feature has different names in different editors. Look for a format option such as
one of the following when you save a document or set the properties for a document:
Plain text
n
ASCII text
n
DOS text
n
Text-only
n
If you're using Windows, there are several editors included with the operating system.
Windows Notepad is a no-frills text editor that only works with plain-text files. It can
handle only one document at a time. Choose Start, All Programs, Accessories, Notepad
to run it on Windows XP or choose Start, Programs, Accessories, Notepad on other
Windows systems.
Windows WordPad is a step above Notepad. It can handle more than one document at a
time and can handle both plain-text and Microsoft Word formats. It also remembers the
last several documents it has worked on and makes them available from the File menu.
It's also on the Accessories menu along with Notepad.
Windows users also can use Microsoft Word, but must save files as text rather than in
Word's proprietary format. (UNIX and Linux users can author programs with emacs,
pico, and vi; Macintosh users have SimpleText or any of the previously mentioned UNIX
tools available for Java source file creation.)
One disadvantage of using simple text editors such as Notepad or WordPad is that they
do not display line numbers as you edit.
Seeing the line number helps in Java programming because many compilers indicate the
line number where an error occurred. Take a look at the following error generated by the
JDK compiler:
Palindrome.java:2: Class Font not found in type declaration.
 
Search WWH ::




Custom Search