Testing J2SE 1.5.0 Installation
<< Installing J2SE 1.5.0 on Windows
<< Java Tool Tutorials - Herong's Tutorial Notes
This section provides a tutorial example of how to enter, compile and execute a simple Java program with newly installed JDK 1.5.0.
Now let's test the JDK 1.5 installation.
1. Use NotePad to enter the following Java program:
class Hello { public static void main(String[] a) { System.out.println("Hello world!"); } }
2. Save this program with the file Hello.java in a working folder C:\herong
3. Then compile this program in a command window with the javac command:
C:\>cd \herong C:\herong> \j2sdk1.5.0\bin\javac Hello.java
3. Finally, execute the program using the java command:
C:\herong>\j2sdk1.5.0\bin\java -cp . Hello Hello world!
Congratulations, you have successfully entered, compiled and executed your first Java program with your newly installed JDK 1.5.0.
Sections in This Chapter
Downloading and Installing J2SE 1.5.0 on Windows