How to Install Java JDK and IDE (Eclipse, IntelliJ) – Beginner Guide
Introduction
Before you start learning Java programming or Java web development (Servlets, JSP, Spring), you must first set up your development environment.
This lesson will guide you step by step through:
Installing Java JDK
Understanding what JDK, JRE, and JVM are
Installing and setting up Eclipse IDE
Installing and setting up IntelliJ IDEA
No prior technical knowledge is required.
What Is Java JDK?
Java JDK (Java Development Kit)
The JDK is a software package required to write, compile, and run Java programs.
JDK Includes:
JVM – Runs Java programs
JRE – Java runtime environment
Compiler (
javac) – Converts Java code to bytecodeTools – Debugger, documentation tools, etc.
Without JDK, you cannot develop Java applications.
Difference Between JDK, JRE, and JVM
| Term | Meaning | Purpose |
|---|---|---|
| JVM | Java Virtual Machine | Runs Java bytecode |
| JRE | Java Runtime Environment | Runs Java programs |
| JDK | Java Development Kit | Develops Java programs |
Developers need JDK.
Installing Java JDK
Step 1: Download Java JDK
Visit the official Java website (Oracle or OpenJDK)
Download JDK 17 or JDK 21 (LTS recommended)
LTS (Long Term Support) versions are best for beginners.
Step 2: Install JDK
Run the installer
Follow default settings
Note the installation path (important)
Example (Windows):
C:\Program Files\Java\jdk-17
Step 3: Set JAVA_HOME (Recommended)
Why JAVA_HOME?
Helps IDEs and servers find Java
Required for tools like Tomcat
Steps (Windows):
Open Environment Variables
Add:
Variable Name:
JAVA_HOMEVariable Value: JDK path
Add
%JAVA_HOME%\binto Path
Step 4: Verify Installation
Open Command Prompt / Terminal:
java -version
javac -version
If version appears, Java is installed correctly.
What Is an IDE?
IDE (Integrated Development Environment)
An IDE helps developers:
Write code faster
Debug easily
Manage projects
Auto-complete code
Popular Java IDEs:
Eclipse
IntelliJ IDEA
Installing Eclipse IDE
Why Choose Eclipse?
Free and open-source
Lightweight
Widely used in education
Excellent for Java & Servlets
Steps to Install Eclipse
Download Eclipse IDE for Java Developers
Run the installer
Select:
Eclipse IDE for Enterprise Java and Web Developers (recommended for Servlets)
Choose install location
Launch Eclipse
First-Time Setup in Eclipse
Select workspace (folder for projects)
Set Java compiler version (JDK 17+)
Create your first Java project
Eclipse automatically detects installed JDK.
Installing IntelliJ IDEA
Why Choose IntelliJ IDEA?
Smart code suggestions
Excellent debugging
Preferred in industry
Clean UI
Versions:
Community Edition (Free) – Enough for learning Java
Ultimate Edition (Paid) – Advanced web support
Steps to Install IntelliJ IDEA
Download IntelliJ IDEA Community Edition
Run installer
Select:
Create desktop shortcut
Add bin to PATH (recommended)
Launch IntelliJ
First-Time Setup in IntelliJ
Choose theme
Select default JDK
Create new Java project
Verify SDK is set correctly
IntelliJ may prompt to download JDK automatically.
Recommended Setup for Servlet Learning
For Java Web Development:
Java JDK 17+
Eclipse Enterprise Edition OR IntelliJ IDEA
Apache Tomcat (later step)
This setup is enough to learn:
Servlets
JSP
Spring MVC