Installation of JDK

The following are the steps to install the Java Development Kit (JDK) on a Windows operating system:

  • Download the JDK installer from the official Oracle website: https://www.oracle.com/java/technologies/javase-downloads.html
  • Run the installer by double-clicking on the downloaded file.
  • Click "Next" on the first few screens to begin the installation process.
  • Accept the license agreement and select the destination folder where you want to install the JDK.
  • Click "Next" to begin the installation.
  • Once the installation is complete, click "Close" to exit the installer.
  • After Installation set or change the PATH system variable using following Steps:

  • Method 1:
    • Open the command prompt or terminal on your system.
    • Type "setx -m JAVA_HOME " followed by the path of the JDK installation directory and press enter. For example, if the JDK is installed in "C:\Program Files\Java\jdk1.8.0_251", you would type "setx -m JAVA_HOME "C:\Program Files\Java\jdk1.8.0_251" or "jdk1.8.0_251" ,it may be different as per version Install.
    • To ensure the environment variable has been set correctly, close the command prompt or terminal and open a new one. Then type "echo %JAVA_HOME%" and press enter. The path you entered in step 2 should be displayed.
    Method 2:
    • Next, open the "System Properties" window by right-clicking on "This PC" and selecting "Properties" or by searching "system environment variable"
    • Click on "Advanced" tab and click on "Environment Variables" button
    • Under System variables, scroll down and find the "Path" variable, click on "Edit" button
    • Click on "New" button and paste the path of bin folder of JDK installation directory. For example, "C:\Program Files\Java\jdk1.8.0_251\bin",it may be different as per version Install.
    • Click on "OK" button to close all windows
    • To verify the installation, open command prompt and type "javac -version" and press enter. It should display the version of JDK installed.

    The following are the steps to install the Java Development Kit (JDK) on a Linux operating system:

    • Download the JDK installer Linux Version from the official Oracle website: https://www.oracle.com/java/technologies/javase-downloads.html
    • Open the terminal, navigate to the directory where the JDK installer is located and type the command:
    • sudo tar -xvf .tar.gz
    • sudo mkdir -p /usr/local/jdk
    • sudo mv /usr/local/jdk
    • sudo update-alternatives --install /usr/bin/java java /usr/local/jdk//bin/java 1
    • sudo update-alternatives --install /usr/bin/javac javac /usr/local/jdk//bin/javac 1
    • sudo update-alternatives --config java
    • sudo update-alternatives --config javac
    • Verify the installation by running the command java -version in the terminal.