Skip to main content

Installation Steps

Windows

  1. Download JDK
    • Go to the official site: Oracle Corporation or OpenJDK (Adoptium)
    • Download the Windows x64 Installer (.exe)
  2. Install Java
    • Double-click the downloaded .exe file
    • Follow the setup wizard (Next → Install → Finish)
  3. Set Environment Variables
    • Open: System Properties → Advanced → Environment Variables Add:
      • JAVA_HOME → Path where JDK is installed
      • Example: C:\Program Files\Java\jdk-21 - Edit Path → Add: %JAVA_HOME%\bin
  4. Verify Installation
    • Open Command Prompt and run:
      • java -version
      • javac -version

Mac/Linux

  1. Download JDK

    • From Oracle Corporation or OpenJDK (Adoptium)
    • Download macOS (.dmg or .pkg)
  2. Install Java

    • Open the .dmg / .pkg file
    • Follow installation instructions
  3. Set Environment Variables (Optional but Recommended)

    • Open Terminal and edit:
        nano ~/.zshrc
    • Add:
     export JAVA_HOME=$(/usr/libexec/java_home)
    export PATH=$JAVA_HOME/bin:$PATH
    • Apply changes:
    source ~/.zshrc
  4. Verify Installation

  • Open the Terminal and run:
       java -version
    javac -version

Install Java using Homebrew (macOS)

  1. Install Homebrew (if not installed)

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Install OpenJDK

    brew install openjdk
  3. Set Environment Variables Add to ~/.zshrc (or ~/.bashrc):

     export JAVA_HOME=$(/usr/libexec/java_home)
    export PATH=$JAVA_HOME/bin:$PATH

    Apply changes:

    source ~/.zshrc
  4. Verify Installation

        java -version
    javac -version

Install Java using SDKMAN (macOS / Linux)

  1. Install SDKMAN

    curl-s"https://get.sdkman.io" |bash
  2. Initialize SDKMAN

    source"$HOME/.sdkman/bin/sdkman-init.sh"
  3. List Available Java Versions

    sdk list java
  4. Install Java (Example: Java 21 LTS)

    sdk install java21-tem
  5. Set Default Version

    sdk default java21-tem
  6. Verify Installation

     java -version
    javac -version