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.

10. Step 7: Run the Program


You need to run the program. That is the point of all this.

Step 7: Run the Program

Enter the command

java HelloPlanets

to run the program. Actually, java starts the Java virtual machine, which then reads in the file of bytecode HelloPlanets.class, which the virtual machine starts executing.

Warning: The command is java with no "c" at the end.

Warning: Use the filename HelloPlanets with no ".class" at the end.


Well, that is one way to do it. Experienced users of Windows will be familiar with most of the steps. They will have found this process fairly easy. If you did not, it is merely a matter of practice (or finding a friend.)

Question 10:

Is Pluto a planet?