Testing Java 8 Installation

This section describes how to compile and run Java programs to test Java 8 (Java Standard Edition Development Kit 1.8) installation on Windows system.

When JDK is installed on your machine, it provides two commands for you to compile and run Java programs.

Let's try these commands with a very simple Java program. Use NotePad 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 compile this program in a command window with the "javac" command:

C:\herong>\progra~1\java\jdk1.8.0\bin\javac Hello.java

To execute the program, use the java command:

C:\herong>\progra~1\java\jdk1.8.0\bin\java Hello
Hello world!

Congratulations, you have successfully entered, compiled and executed your first Java program.

Last update: 2015.

Table of Contents

 About This Book

 Java Tools Terminology

Installing Java 8 on Windows

 Downloading and Installing Java 8 on Windows

Testing Java 8 Installation

 'javac' - The Java Program Compiler

 'java' - The Java Program Launcher

 'jdb' - The Java Debugger

 'jconsole' - Java Monitoring and Management Console

 'jstat' - JVM Statistics Monitoring Tool

 JVM Troubleshooting Tools

 jvisualvm (Java VisualVM) - JVM Visual Tool

 'jar' - The JAR File Tool

 'javap' - The Java Class File Disassembler

 'keytool' - Public Key Certificate Tool

 'native2ascii' - Native-to-ASCII Encoding Converter

 Outdated Tutorials

 References

 PDF Printing Version