Java Reference
In-Depth Information
The preceding steps should set the Path . To be absolutely certain about the Path and
also to set the CLASSPATH , check your operating system's documentation.
Executing Java Programs
The following discussion assumes that you have set the Path so that the files javac.exe
and java.exe can be executed from within any subdirectory.
You can use an editor such as Notepad to create Java programs. The name of the class
containing the Java program and the name of the file containing the program must be the
same. Moreover, the file containing the Java program must have the extension .java .
Suppose that the file Welcome.java is in the subdirectory c:\jpfpatpd and contains
the following Java application program:
public class Welcome
{
public static void main(String[] args)
{
System.out.println("Welcome to Java Programming.");
}
}
We assume that you have switched to the subdirectory c:\jpfpatpd (see Figure D-9).
FIGURE D-9 Windows console environment
 
Search WWH ::




Custom Search