Logo
Environment Setup
Environment SetupInstalling JDK

Installing JDK

The Java Development Kit (JDK) is an essential tool for developing Java applications, including Spring Boot projects. Here's a step-by-step guide to installing the JDK on different operating systems.

Windows

  1. Download Installer: Visit the official Oracle website to download the Windows installer for JDK. Alternatively, you can use open-source distributions like AdoptOpenJDK.

  2. Run Installer: Double-click the downloaded .exe file to start the installation process. Follow the on-screen instructions to complete the installation.

  3. Set Environment Variable:

    • Right-click on 'My Computer' or 'This PC' and select 'Properties'.
    • Click on 'Advanced system settings' and then 'Environment Variables'.
    • Add a new system variable with the name JAVA_HOME and the value as the path to your JDK installation, e.g., C:\Program Files\Java\jdk-11.
  4. Update PATH: Edit the PATH system variable to include %JAVA_HOME%\bin.


macOS

  1. Download Installer: Visit the official Oracle website and download the macOS .dmg installer.

  2. Run Installer: Open the downloaded .dmg file and drag the JDK into the Applications folder.

  3. Set Environment Variable: Open Terminal and add the following line to your .bash_profile or .zshrc file.

    export JAVA_HOME=$(/usr/libexec/java_home)

Linux

  1. Download Installer: Download the Linux .tar.gz file from the official Oracle website.

  2. Extract Archive: Open Terminal and run the following command to extract the downloaded archive.

    tar -xvf jdk-11.tar.gz
  3. Move to Installation Directory: Move the extracted folder to /usr/lib/jvm/.

    sudo mv jdk-11 /usr/lib/jvm/
  4. Set Environment Variable: Open .bashrc or .zshrc and add the following lines.

    export JAVA_HOME=/usr/lib/jvm/jdk-11
    export PATH=$PATH:$JAVA_HOME/bin

After completing these steps, open a new terminal window and run java -version to verify that the JDK has been successfully installed.

Book a conversation with us for personalize training today!

Was this helpful?
Logo