Learn how to install Java JDK 21 on your Mac with these simple steps! ==================== Step 1 ==================== To start, ensure Java is not already installed by running the command java -version in your terminal. If you receive an error like "zsh: command not found: java" or "Unable to locate a Java Runtime," proceed to the installation steps. ==================== Step 2 ==================== Open your browser and navigate to https://www.oracle.com/java/technolog... Click on the macOS tab. Depending on your Mac chip: If you have an Apple M chip, download the ARM64 DMG Installer. If you have an Intel chip, download the x64 DMG Installer. Run the downloaded file and follow the installation prompts. ==================== Step 3 ==================== After installation, run the command java -version in your terminal to verify the installation. ==================== Step 4 ==================== Add the JAVA_HOME environment variable to your terminal config file: Navigate to your user folder in the terminal by entering cd ~/. To reveal hidden files in Finder, press command + shift + .. Create a terminal config file if you don't already have one: Enter touch .zshrc or touch .bash_profile (if your terminal uses bash). Determine the folder name for your Java installation: Go to /Library/Java/JavaVirtualMachines/. Copy the folder name (e.g., "jdk-21.jdk") of your Java installation. Open the terminal config file in a text editor and add the following line at the beginning: export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home Save the changes and close the file (command + s, command + q). Restart or close all terminal windows and reopen them to apply the new configuration. ==================== Step 5 ==================== Once again, run the command java -version in your terminal to confirm the installation was successful. ==================== Step 6 ==================== Finally, in your IDE, navigate to File - Project Structure - Platform Settings - SDKs and select the installed JDK for your project. ======================================== In this video, I have explained how we can install OracleJDK 21 on MacOS without homebrew. ======================================== I have shown the install process using DMG file for Macbook M1 which is silicon based system. Though the steps would be same for Intel based system and Macbook M2 also. Still, in case of any issue, let me know in comments. ======================================== Oracle's Official Website Link: https://www.oracle.com/in/java/techno... ======================================== Website: https://skilledengg.com/ ======================================== Homebrew Course Playlist: • What is Homebrew | Homebrew Introduction |... ======================================== #java #jdk #oraclejdk #install, #java21 #macos #mac #terminal #installation #install #technology #software #softwareengineer #softwaredeveloper #softwareengineering #softwaredevelopment