Creating or Editing a Java File

This is part in a series where I blog some of the common threads from my Intro to Programming course.

Writing a Java program requires the use of a text-editor. And any will do actually.

If you're using Linux based system, I'm sure you're already familar with using an editor. However, for my Windows-based students this may be new territory.

A text-editor that you may be familiar with is MS Word. Word, like many document editors offer various helpful features. When you save a document in Word, it generates a file with an extension of ".doc" that you can move or re-open later. HOWEVER, we're writing programs and we need an editor that actually helps us write a file with a ".java" file extension. Please do not use MS Word to write your programs :-)

Simple text-editors that you may use are: Notepad, Notepad++, and ConTEXT among many others.

Notepad: Notepad is already installed with Windows. You can access it from the Start menu or use the following commands: "cntrl-r: then type notepad". If you try to write a Java program with notepad, make sure that the file is saved as a ".java" program. Notepad will always try to save a new file as ".txt", so the first save may look like "". You will need to rename that file through the explorer or command prompt.

Notepad++: From the website - "Notepad++ is a free (as in "free speech" and also as in "free beer") source code editor and Notepad replacement that supports several languages. Running in the MS Windows environment, its use is governed by GPL Licence.

Based on a powerful editing component Scintilla, Notepad++ is written in C++ and uses pure Win32 API and STL which ensures a higher execution speed and smaller program size. By optimizing as many routines as possible without losing user friendlyness, Notepad++ is trying to reduce the world carbon dioxide emissions. When using less CPU power, the PC can throttle down and reduce power consumption, resulting in a greener environment."

ConTEXT: From the website - "is a small, fast and powerful freeware text editor, developed to serve as a secondary tool for software developers. After years searching for a suitable Windows text editor, we didn't find any of them to satisfy our needs, so we wrote our own."

What editor do you use or recommend? I personally use Text-Mate or Vi. Occasionally I'll use Eclipse (it's way too powerful for a new programmer though).

Jeff mentioned:
My computer is a Mac, and I'm using a text editor called SubEthaEdit. I recommend using it because is has syntax highlighting, which puts the Java keywords and comments in different colors. I'm using SubEthaEdit version 1.1.5 (version 2.2 didn't work on my computer). I downloaded it for free at
Campbell and Stephen wrote:
I found a decent integrated development environment program that is a free download that works well with Java. You can edit java files and compile them from the same window, and it automatically formats your indents from line to line.