Step-by-Step Guide to Installing Java

I'm a Software Engineer with a strong technical background in building impactful SaaS solutions, web applications, and mobile platforms. My expertise spans programming languages like Java, JavaScript, and PHP, alongside frameworks such as Spring Boot, Vue.js, and Node.js. I thrive on creating reliable, scalable, and user-centered applications that solve real-world challenges. Throughout my career, I’ve paired my technical journey with a passion for mentoring and training. As a mentor and trainer, I’ve guided aspiring developers, particularly at institutions like École 229, through immersive learning experiences. My approach combines practical projects, collaborative problem-solving, and innovative teaching methods to foster both technical expertise and essential team dynamics. Beyond coding, I bring a strong set of soft skills—including communication, adaptability, and problem-solving—that enable me to drive successful project outcomes and support the growth of those around me. Some of my most notable achievements include developing a secure e-commerce application following Agile best practices and delivering numerous WordPress sites that enhanced brand presence and user experience for small businesses. Looking ahead, I am eager to transition into a Product Owner role, where I can bridge the gap between technical development and strategic vision. My goal is to leverage my technical expertise, mentoring experience, and user-focused approach to shape products that deliver real value and resonate with their audiences. Feel free to reach out if you'd like to discuss technology, product management, or collaborative projects :)
Introduction
Java is a versatile and widely-used programming language. To start developing in Java, you first need to install the Java Development Kit (JDK) on your machine. This guide will walk you through the steps to install Java on Windows, macOS, and Linux.
Checking for Existing Java Installation
Before installing Java, check if it is already installed on your system.
On Windows
Open Command Prompt.
Type
java -versionand press Enter.
On macOS
Open Terminal.
Type
java -versionand press Enter.
On Linux
Open Terminal.
Type
java -versionand press Enter.
If Java is installed, you will see the version number. If not, proceed with the installation steps below.
Installing Java on Windows
Download the JDK
Go to the Oracle JDK download page.
Choose the latest JDK version and download the Windows installer (e.g.,
jdk-XX_windows-x64_bin.exe).
Run the Installer
Open the downloaded installer file.
Follow the on-screen instructions to complete the installation.
Set Up Environment Variables
Open the Start menu, search for "Environment Variables," and select "Edit the system environment variables."
In the System Properties window, click on "Environment Variables."
Under System Variables, click "New" and add a new variable:
Variable name:
JAVA_HOMEVariable value: Path to your JDK installation (e.g.,
C:\Program Files\Java\jdk-XX).
Edit the
Pathvariable and add%JAVA_HOME%\bin.
Installing Java on macOS
Download the JDK
Visit the Oracle JDK download page.
Download the macOS installer (e.g.,
jdk-XX_macos-x64_bin.dmg).
Install the JDK
Open the downloaded
.dmgfile.Double-click the
.pkginstaller and follow the instructions.
Set Up Environment Variables
Open Terminal.
Edit the
.bash_profileor.zshrcfile (depending on your shell):nano ~/.bash_profileor
nano ~/.zshrcAdd the following lines:
export JAVA_HOME=$(/usr/libexec/java_home) export PATH=$JAVA_HOME/bin:$PATHSave and close the file, then run
source ~/.bash_profileorsource ~/.zshrc.
Installing Java on Linux
Download the JDK
Visit the Oracle JDK download page.
Download the Linux tar.gz file (e.g.,
jdk-XX_linux-x64_bin.tar.gz).
Install the JDK
Open Terminal.
Extract the tar.gz file to
/opt:sudo tar -xzf jdk-XX_linux-x64_bin.tar.gz -C /optSet up the
JAVA_HOMEandPATHvariables by adding the following lines to your.bashrcor.zshrcfile:export JAVA_HOME=/opt/jdk-XX export PATH=$PATH:$JAVA_HOME/binSave and close the file, then run
source ~/.bashrcorsource ~/.zshrc.
Setting Up Environment Variables
For all operating systems, ensure the environment variables are set correctly:
JAVA_HOME: Points to the JDK installation directory.
PATH: Includes
$JAVA_HOME/binto ensure Java executables are available globally.
Verifying the Installation
Open a new terminal or command prompt.
Type
java -versionand press Enter.You should see the installed Java version, indicating the installation was successful.

Conclusion
You've successfully installed Java on your system. Now you're ready to start developing Java applications.




