Upgrade to Pro

Steps to install the Java Development Kit (JDK) on Windows, macOS, and Linux.

 1. Choose JDK Version and Vendor

Popular JDK vendors:

  • Oracle JDK – official version

  • OpenJDK – open-source

  • Amazon Corretto, Azul Zulu, Adoptium – alternative builds

 For most purposes, Adoptium Temurin or Oracle JDK is recommended.

 Windows Installation

Option 1: Using Oracle JDK

  1. Go to: https://www.oracle.com/java/technologies/javase-downloads.html

  2. Select the version (e.g., Java 17 or Java 21 LTS).

  3. Download the .exe installer.

  4. Run the installer and follow the prompts.

  5. Verify installation:
    Open Command Prompt and run:

    java -version
    javac -version
    

Option 2: Using Adoptium (OpenJDK)

  1. Go to: https://adoptium.net/

  2. Choose a version (e.g., Java 17) and Windows OS.

  3. Download the MSI Installer.

  4. Install and follow prompts.

  5. Confirm with:

    java -version
    

 macOS Installation

Option 1: Oracle JDK

  1. Go to https://www.oracle.com/java/technologies/javase-downloads.html

  2. Download the macOS .dmg installer.

  3. Open and run the installer.

  4. To verify:

    java -version
    

Option 2: Using Homebrew (Recommended for developers)

  1. Open Terminal.

  2. Run:

    brew install openjdk@17
    
  3. Add Java to your PATH:

    echo 'export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"' >> ~/.zprofile
    source ~/.zprofile
    
  4. Verify:

    java -version
    

 Linux Installation (Ubuntu/Debian)

Option 1: Default JDK from Repository

sudo apt update
sudo apt install default-jdk -y

Option 2: Install Specific Version (e.g., OpenJDK 17)

sudo apt install openjdk-17-jdk -y

Verify Installation:

java -version
javac -version

 After Installation

  1. Set JAVA_HOME (Optional but useful):

    • On Windows: Set Environment Variable JAVA_HOME to the JDK path (e.g., C:\Program Files\Java\jdk-17)

    • On Linux/macOS:

      export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))
      export PATH=$JAVA_HOME/bin:$PATH
      
  2. IDE Integration: Install an IDE like IntelliJ IDEA, Eclipse, or VS Code with Java extensions.

Flowisetech For easy access