To Documents

Download Directions for Windows, Java 11 JDK

A. Download JDK 11

  1. Go to the AdoptOpenJDK site:
        https://adoptopenjdk.net
  2. Select OpenJDK 11 (LTS) as the version and HotSpot as the JVM. (JVM means Java Virtual Machine.)
  3. Click the Latest Release button to save the Windows installation file (for example OpenJDK11U-jdk_x64_windows_hotspot_***.msi) on your Windows machine. The characters in the area marked by *** indicate the Java version.
  4. Click the Other Versions button to download the macOS x64 version.
  5. There are Java 11 versions other than AdoptOpenJDK that are also available. Either save the file in the Downloads folder or in a file that you create, such as JavaDownload.

B. Install Java 11 JDK

  1. Double click the .msi file that you downloaded in the previous section. The Installation Wizard will start and guide you through the process. In the Custom Setup Dialog, select these four features: (1) Add to path, (2) Associate .jar, (3) Set JAVA_HOME variable. Select Yes in the User Account Control dialog to give permission to the installer to make changes to your device.

C. Test Java Installation

  1. In a Command Prompt Window, type
    javac -version
    
    The output should be
    javac 11.0.4
    
  2. Also in the Command Prompt Window, type
    java -version
    
    You should see information similar to this:
    openjdk version "11.0.4" 2019-07-16
    OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.4+11)
    OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.4+11, mixed mode)
    
  3. Now you are ready to create and run a HelloWorld application.
    1. Using NotePad or other text editor such as Brackets, create a file named Hello.java with these lines:
      public class HelloWorld
      {
          public static void main(String[ ] args)
          { 
              System.out.println("Hello, World!");
          }
      }
      
  4. Complile the source code file HelloWorld.java like this:
    javac HelloWorld.java
    
  5. Type the command dir. You should see that the executable file HelloWorld.class has been created.
  6. Run the executable file like this:
    java HelloWorld
    
    You should see the program output
    Hello, World!
    
    Now you are ready to go with Java.