shape
shape

Setting up JDK

Login Signup
Course Content
Advanced Java: Build Scalable, Secure, and Modern Apps

Setting Up JDK on Windows 11

Step 1: Download the JDK

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

  1. Open Start Menu → search for Environment Variables → click Edit the system environment variables.
  2. In the System Properties window, click Environment Variables.
  3. Under System Variables, find and select Path, then click Edit.
  4. Click New and add the path to the JDK’s bin folder (e.g., C:\Program Files\Java\jdk-21\bin).
  5. 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

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).
0% Complete