Java from the DOS Prompt
- Create a folder with the source code (.java) files,
one file for each class. To start, just create a simple
Main class with a main method with NotePad.
- Open a DOS Window (called a Command Window in Windows 2000).
- Check the path by entering "path". See if
C:\JDK1.3\BIN is in the
path.
- If jdk1.3 is not in the path, add it to the path:
set PATH=c:\jdk1.3\bin;%PATH%
Note: the drive and path to JDK1.3 might be different on
your computer or in the computer labs. However, the path in the
computer labs should already be okay.
- Compile all .java files. For example:  
javac Main.java
- Clear the CLASSPATH as follows:  
set CLASSPATH=
- Execute the main method in the class Main. For example:  
java Main