Posts

Showing posts with the label java setup

๐Ÿ’ป How to Download and Install Java on Mac and Ubuntu – Step-by-Step Guide

How to Download and Install Java on Mac and Ubuntu Java is not just a programming language—it’s the base of many big applications across mobile, web, and enterprise systems. But before we dive into our Java coding journey, let’s first install Java properly. This post will help you install Java (OpenJDK) on: ✅ macOS ✅ Ubuntu (Linux) ๐Ÿ Part 1: Install Java on macOS We’ll use Homebrew , a popular package manager for macOS. ๐Ÿ› ️ Step-by-step instructions: ✅ Step 1: Check if Homebrew is installed brew -v If it’s not installed, run the following: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ✅ Step 2: Install OpenJDK brew install openjdk@21 ✅ Step 3: Add Java to your system PATH For zsh users (macOS default shell): echo 'export PATH="/opt/homebrew/opt/openjdk@21/bin:$PATH"' >> ~/.zshrc source ~/.zshrc For bash users : ...