🚀 How to Install Java (JDK) and Maven on Windows 10/11 – Step by Step
Java is one of the most popular programming languages, and Maven is a powerful build automation tool used for Java projects. In this tutorial, I’ll show you how to install Java JDK and Apache Maven on a Windows machine from scratch.
🔹 Step 1: Check Existing Java Installation
Before installing, check if Java is already installed:
java -version
javac -version
- If Java is installed, you’ll see something like:
java version "1.8.0_121"
javac 11.0.16.1
⚠️ If the versions don’t match (e.g., JRE is Java 8, but javac is Java 11), it’s recommended to update to the latest version.
🔹 Step 2: Download Java JDK
Go to the official Oracle JDK download page: Oracle Java Downloads
Find the latest Java SE Development Kit (JDK). Example: Java 25 LTS.
Under Windows, download the x64 Installer (
.exe).
🔹 Step 3: Install Java JDK
- Double-click the downloaded installer.
Follow the setup wizard:
- Keep the default installation path (e.g.,
C:\Program Files\Java\jdk-25). - Click Next and Finish when installation completes.
- Keep the default installation path (e.g.,
🔹 Step 4: Set JAVA_HOME and Update PATH
Press Win + S → type
Environment Variables→ open Edit the system environment variables → click Environment Variables.Create JAVA_HOME
- Click New under System variables.
- Variable name:
JAVA_HOME - Variable value:
C:\Program Files\Java\jdk-25
Add to PATH
- Select Path → Edit → New →
%JAVA_HOME%\bin - Move it to the top to take priority.
- Select Path → Edit → New →
Click OK to save.
🔹 Step 5: Verify Java Installation
Open a new Command Prompt and type:
echo %JAVA_HOME%
java -version
javac -version
Expected output:
C:\Program Files\Java\jdk-25
java version "25" 2025-09-16 LTS
javac 25
✅ This confirms Java is correctly installed and configured.
🔹 Step 6: Download Apache Maven
Go to the official Apache Maven download page: Apache Maven Downloads
Download the Binary zip archive of the latest version. Example:
apache-maven-3.9.11-bin.zipExtract it to a folder, for example:
C:\Maven\apache-maven-3.9.11
🔹 Step 7: Set M2_HOME and Add Maven to PATH
Open Environment Variables again.
Create M2_HOME
- Click New under System variables.
- Variable name:
M2_HOME - Variable value:
C:\Maven\apache-maven-3.9.11
Add Maven to PATH
- Select Path → Edit → New →
%M2_HOME%\bin - Move it to the top.
- Select Path → Edit → New →
Click OK to save.
🔹 Step 8: Verify Maven Installation
Open a new Command Prompt and run:
mvn -version
Expected output:
Apache Maven 3.9.11 (xxxx)
Maven home: C:\Maven\apache-maven-3.9.11
Java version: 25, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk-25
✅ Maven is installed and correctly using your Java setup.
🔹 Summary Table of Installed Versions
| Tool | Version |
| Java | 25 LTS |
| Javac | 25 |
| Maven | 3.9.11 |
✅ Conclusion
You now have Java JDK 25 and Apache Maven 3.9.11 installed and fully configured on Windows.
Your system is ready for Java development, building projects, and running Maven-based applications.
💡 Tips:
- Always use the latest LTS version of Java for production projects.
- Keep JAVA_HOME and M2_HOME updated when upgrading.
- Using Maven with Java 25 ensures compatibility with modern libraries and frameworks.
