Testing JDK Installation

This section describes how to compile and run Java programs to test JDK installation on Windows system.

When JDK is installed, it provides two commands for us to compile and run Java programs.

To try these commands, I used a text editor to enter the following Java program into a file called Hello.java:

class Hello {
   public static void main(String[] a) {
      System.out.println("Hello world!");
   }
}

Then compiled this program in a command window with the "javac" command:

herong> javac Hello.java

Finally, executed the program with the "java" command:

herong> java Hello
Hello world!

Congratulations, I have successfully entered, compiled and executed our first Java program.

Table of Contents

 About This Book

 Java Tools Terminology

Java Tools Included in JDK

 Installing Latest JDK on macOS

 Installing Latest JDK on Windows

 Adding JDK "bin" Direcotry to Path Setting

Testing JDK Installation

 Listing Java Tools in JDK

 javac - The Java Program Compiler

 java - The Java Program Launcher

 jar - The JAR File Tool

 jlink - The JRE Linker

 jmod - The JMOD File Tool

 jimage - The JIMAGE File Tool

 jpackage - Binary Package Builder

 javadoc - The Java Document Generator

 jdeps - The Java Class Dependency Analyzer

 jdeprscan - The Java Deprecated API Scanner

 jdb - The Java Debugger

 jcmd - The JVM Diagnostic Tool

 jconsole - Java Monitoring and Management Console

 jstat - JVM Statistics Monitoring Tool

 JVM Troubleshooting Tools

 jhsdb - The Java HotSpot Debugger

 jvisualvm (Java VisualVM) - JVM Visual Tool

 jmc - Java Mission Control

 javap - The Java Class File Disassembler

 keytool - Public Key Certificate Tool

 jarsigner - JAR File Signer

 jshell - Java Language Shell

 jrunscript - Script Code Shell

 Miscellaneous Tools

 native2ascii - Native-to-ASCII Encoding Converter

 JAB (Java Access Bridge) for Windows

 Archived Tutorials

 References

 Full Version in PDF/EPUB