This article explains method of installing of JDK in Windows. Also to verify JDK after instillation.

Background

The Java Development Kit (JDK) is a distribution of Java Technology by Oracle Corporation. It implements the Java Language Specification (JLS) and the Java Virtual Machine Specification (JVMS) and provides the Standard Edition (SE) of the Java Application Programming Interface (API). It provides software for working with Java applications. Examples of included software are the virtual machine, a compiler, performance monitoring tools, a debugger, and other utilities that Oracle considers useful for a Java programmer. - wikipedia.org

Download JDK

  1. Search JDK download at search engine,

  2. Open Java download of oracle website,

  1. Choose the correct OS according for specific JDK (Windows,Mac,Linux),

  1. Scrool or search for compactiable installer for your platform,

  1. Click on related installer and accept terms and condition then click on download,

  1. After some time download will be completed.

Install JDK

  1. Once the download is complete go to downloads at My PC where you find the JDK application,

  1. Then, execute(open) the file to begin the installation of JDK,

  2. After you double click the JDK file, a pop up asking you where your source java file will be (You can choose to change but better to stick with original location). Click next to all criteria,

  1. Then, after some time JDK will be install in your device,

Set environment variable

  1. Go to search menu and search advanced system settings,

  1. Select Advanced System Setting. Click on Environment Variables (at the bottom right corner),

  1. There will be two environment variables, one is the User variable and another is a System variable.

  2. If path and classpath variables are already present in System Variable, click on it to edit. Otherwise, set a new variable.

    User variable :
    
  • For New :

    • Select New,

    • Add the variable name and variable value as following,

    • For variable value set location of jdk,

  • For Edit,

    Set only variable value.

    System Variable : 
    
  • For New :

    Select New, add the variable name as Path and variable value as below,

  • For Edit :

    • Select path and click edit,

    • Edit environmental variable as following,

    • Set the classpath variable by adding the following classpath directory path,

    Then, Click on apply and ok on system properties.

    Now, you have done with Java JDK setup. 
    

Verify Installiation

We can use javac -version to find out the version of the installed JDK.

  1. We have to open command prompt,

  2. Then, type javac -version and hit enter,

  3. JDK version will be displayed.

In the above example, the JDK version is 18.0.1