Running Example Programs

This chapter provides step-by-step instructions of writing a Java program using a text editor, and then compiling and running this program from command prompt. Several Integrated Development Environments (IDEs) are mentioned in this chapter. We have already installed NetBeans. That and Eclipse are the most popular in Java professional practice.

2. Notes


Yes — sometimes typing in a program forces you to see details you would otherwise miss.
Other times it is a waste of effort. Of course, not running the program at all is a
supreme waste of opportunity.


1. The steps are for Windows 10. Nearly the same steps can be used for other varieties of Windows. The software used in these notes is the minimum possible requirement, free on all Windows computers. Even if you have better software it is wise to start out using this minimum.

2. If you use an integrated programming environment (IDE) such as Eclipse or BlueJ you can copy programs into your environment and run them. But most IDEs require your program to be part of a "project" which takes some effort to set up. To quickly copy a program and run it, the steps described here are best.

3. Rather than use Notepad, you can use the Notepad++ programming editor. It is free, simple and easy to use, but it is a big improvement over Notepad. See

4. For writing big programs, a free Java IDE such as BlueJ may be your best choice. See

If you decide to use an IDE you will have to learn how to use it. For short programs, Notepad++ (or other editor) and the command line are easiest.

Question 2:

Can Microsoft Word be used as a program editor?