Installation of Java on Windows
-
Download Java:
- Go to https://www.oracle.com/java/technologies/javase-downloads.html.
- Select Windows and click Download (typically the JDK).
-
Start Installation:
- Run the downloaded
.exe
file. - Click Next and follow the instructions in the wizard.
- Run the downloaded
-
Set Environment Variable (Path):
- After installation, go to Control Panel → System and Security → System → Advanced System Setting.
- Select Environment Variables.
- Find Path under System variables.
- Add your Java’s
bin
directory (for example:C:\Program Files\Java\jdk-17\bin
) toPath
.
-
Verify Installation:
-
Open cmd or PowerShell.
-
Type:
java -version
-
It should show the installed Java version.
-
Installation of Java on Mac
-
Download Java:
- Visit https://www.oracle.com/java/technologies/javase-downloads.html.
- Select macOS and click Download (JDK .dmg).
-
Start Installation:
- Open downloaded
.dmg
. - Double-click JDK.pkg.
- Follow the instructions in the installation wizard.
- Open downloaded
-
Set Environment Variable (Path) (optional if not automatic):
-
Open
~/.zshrc
or~/.bash_profile
. -
Add:
export JAVA_HOME=$(/usr/libexec/java_home) export PATH=$JAVA_HOME/bin:$PATH
-
Reload:
source .zshrc
-
-
Verify Installation:
java -version
- Prints the installed Java version.
Installation of Java on Ubuntu
-
Open terminal.
-
Update package index first:
sudo apt update
-
Installing Java (OpenJDK is recommended):
sudo apt install default-jdk
or for a specific version:
sudo apt install openjdk-17-jdk
-
Verify Installation:
java -version
- Prints the installed Java version.
At Online Learner, we're on a mission to ignite a passion for learning and empower individuals to reach their full potential. Founded by a team of dedicated educators and industry experts, our platform is designed to provide accessible and engaging educational resources for learners of all ages and backgrounds.
Terms Disclaimer About Us Contact Us
Copyright 2023-2025 © All rights reserved.