Setting Up JDK on Windows 11
Step 1: Download the JDK
- Go to the official Oracle JDK page: https://www.oracle.com/java/technologies/javase-downloads.html
- Click on the latest version (e.g., Java 21 or Java 17 LTS).
- Download the Windows x64 Installer (.exe).
Step 2: Install the JDK
- Run the downloaded .exe file.
- Follow the installation wizard:
- Click Next
- Choose the installation path (or leave it default)
- Click Install
- Click Close when installation completes.
Step 3: Set Environment Variables
- Open Start Menu → search for Environment Variables → click Edit the system environment variables.
- In the System Properties window, click Environment Variables.
- Under System Variables, find and select Path, then click Edit.
- Click New and add the path to the JDK’s bin folder (e.g., C:\Program Files\Java\jdk-21\bin).
- Click OK to save.
Step 4: Verify Installation
- Open Command Prompt and type: java -version javac -version
- You should see the installed version of Java.
Setting Up JDK on macOS
Step 1: Download the JDK
- Visit: https://www.oracle.com/java/technologies/javase-downloads.html
- Choose the latest version and download the macOS Installer (.dmg).
Step 2: Install the JDK
- Open the downloaded .dmg file.
- Double-click the .pkg installer inside.
- Follow the installation steps and complete the setup.
Step 3: Verify Installation
- Open Terminal and type: java -version javac -version
- You should see the installed version of Java.
Optional: Set JAVA_HOME
- Add the following to your shell profile (.zshrc or .bash_profile):
- export JAVA_HOME=$(/usr/libexec/java_home)
- export PATH=$JAVA_HOME/bin:$PATH
- Save and run source ~/.zshrc (or source ~/.bash_profile).

