|
by
[Exercise |
API Docs |
Short Course|
Exercises]
|
For most environments, the source code should be in a file named SimpleProgram.java.
Some environments, however, are not source file-oriented (for example, VisualAge for Java), in which
case you simply type the code into the appropriate IDE window(s).
Task 2
Compile the Java source file SimpleProgram.java.
Some Java environments require a CLASSPATH setting. You should set the
CLASSPATH environment variable to include the current directory. With the Java
Development Kit (JDK) from Sun Microsystems, you can compile SimpleProgram.java
easily from the command line:
D:\>javac SimpleProgram.java
Execute SimpleProgram.
With the JDK, for example, simply invoke the Java interpreter with SimpleProgram as
an argument:
D:\>java SimpleProgram
Copyright 1996-2000 jGuru.com. All Rights Reserved.
|
| ||||||||||||