Compile your Application | Heaton Research

Compile your Application

Get the entire book!
Java for the Beginning Programmer

Now I will show you how to compile your application. To do this, return to the command prompt window and enter:

javac HelloWorld.java

This will compile your application. Compiling is the process by which your source code is changed into a form that the computer can understand. This is also where you will see compile errors if you have entered anything incorrectly. You can see a successful compile in Figure 2.22.

Figure 2.22: View the Class File

View the Class File

If you would like to see what the compiler created enter the command:

dir

This will show you a file called HelloWorld.class. This is the compiled form of your program that can be executed. You will see how to do this in the next section.

Copyright 2005-2008 by Heaton Research, Inc.