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 bytecode

  • Tools – Debugger, documentation tools, etc.

Without JDK, you cannot develop Java applications.

Difference Between JDK, JRE, and JVM

TermMeaningPurpose
JVMJava Virtual MachineRuns Java bytecode
JREJava Runtime EnvironmentRuns Java programs
JDKJava Development KitDevelops 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):

  1. Open Environment Variables

  2. Add:

    • Variable Name: JAVA_HOME

    • Variable Value: JDK path

  3. Add %JAVA_HOME%\bin to 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

  1. Download Eclipse IDE for Java Developers

  2. Run the installer

  3. Select:

    • Eclipse IDE for Enterprise Java and Web Developers (recommended for Servlets)

  4. Choose install location

  5. 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

  1. Download IntelliJ IDEA Community Edition

  2. Run installer

  3. Select:

    • Create desktop shortcut

    • Add bin to PATH (recommended)

  4. 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