CBSE Java Setup Lesson

Installing Java IDEs and Using Them

Learn how to set up Java and start coding with four popular IDEs: Eclipse, Apache NetBeans, Visual Studio Code, and IntelliJ IDEA.

Install Java First Choose an IDE First Program

Lesson Roadmap

1. What is an IDE?

IDE means Integrated Development Environment. It is a software application where we write, run, test, and debug programs.

Editor
The place where you write Java code.
Compiler support
Helps convert Java code into bytecode.

Watch First: Installing and Using Java IDEs

Watch this video first, then follow the step-by-step written lesson below to install Java IDEs and run your first Java program.

Run button
Lets you execute your program easily.
Debugger
Helps you find mistakes step by step.
Important: An IDE is not Java itself. Java must be installed separately through the Java Development Kit, also called JDK.

2. Install Java JDK First

Before installing any Java IDE, install the Java Development Kit (JDK). The JDK contains the tools needed to compile and run Java programs.

Recommended beginner setup

Item Recommended choice
Java version Use a current Long-Term Support version or the latest stable JDK available from Oracle/OpenJDK.
Operating system Windows, macOS, or Linux
First check Run java -version in Terminal or Command Prompt.

Install steps

1
Open the official Java JDK download page.
Search: Oracle Java JDK download or OpenJDK download.
2
Download the installer for your operating system.
For Windows, choose the x64 installer if your system is 64-bit.
3
Install it using the normal installer.
Keep the default settings unless your teacher gives a special instruction.
4
Open Command Prompt or Terminal and type:
java -version
Then type:
javac -version
Checkpoint: If Java is installed correctly, both commands should show a version number. Example:
java version "21..."
javac 21...

3. Which IDE Should You Choose?

All four IDEs can be used for learning Java. For CBSE students, the best IDE is the one that lets you write, run, and understand simple Java programs without confusion.

Eclipse

Good for school and college Java. Many Java developers have used Eclipse for years.

Best for: Classic Java learning and project-based practice.

Apache NetBeans

Simple, friendly, and excellent for beginners. Project creation is easy.

Best for: Beginners who want a clear Java project structure.

Visual Studio Code

Lightweight editor with Java extensions. Very useful if you also learn web development.

Best for: Students who want one editor for Java, HTML, CSS, JavaScript, and Python.

IntelliJ IDEA

Modern and powerful Java IDE. The Community Edition is enough for core Java.

Best for: Serious learners who want smart suggestions and a polished interface.
Simple recommendation: For a school student, start with NetBeans or IntelliJ IDEA Community Edition. If you already use VS Code for other languages, use VS Code with Java extensions.

4. Installing and Using Eclipse for Java

Eclipse is a popular Java Integrated Development Environment. It is especially useful for understanding Java projects, packages, classes, and debugging.

Installation steps

1
Search for Eclipse IDE download.
2
Download Eclipse IDE for Java Developers.
3
Install and open Eclipse.
4
Choose a workspace folder. This is where Eclipse will save your projects.

Create your first Eclipse project

  1. Click File.
  2. Click New.
  3. Click Java Project.
  4. Project name: FirstJavaProject.
  5. Click Finish.
  6. Right-click src.
  7. Click NewClass.
  8. Class name: HelloJava.
  9. Select public static void main(String[] args) if the option appears.
  10. Click Finish.
public class HelloJava {
    public static void main(String[] args) {
        System.out.println("Hello Java from Eclipse!");
    }
}
Checkpoint: Click the green Run button. You should see:
Hello Java from Eclipse!

5. Installing and Using Apache NetBeans for Java

Apache NetBeans is a beginner-friendly IDE for Java. It provides project templates, code highlighting, and easy Run buttons.

Installation steps

1
Search for Apache NetBeans download.
2
Download the installer for your operating system.
3
Install NetBeans and open it.

Create your first NetBeans project

  1. Click File.
  2. Click New Project.
  3. Select Java with Ant or Java with Maven.
  4. Select Java Application.
  5. Project name: FirstNetBeansJava.
  6. Click Finish.
public class Main {
    public static void main(String[] args) {
        System.out.println("Hello Java from NetBeans!");
    }
}
Checkpoint: Click Run Project. The Output window should show:
Hello Java from NetBeans!
Note: NetBeans may create a package automatically. That is normal. Keep your class inside the created package unless your teacher asks otherwise.

6. Installing and Using Visual Studio Code for Java

Visual Studio Code, also called VS Code, is a lightweight editor. To use it properly for Java, install the Java extensions.

Installation steps

1
Install the Java JDK first.
2
Install Visual Studio Code.
3
Open VS Code and go to Extensions.
4
Search for Extension Pack for Java and install it.

Create your first VS Code Java file

  1. Create a folder named java-practice.
  2. Open that folder in VS Code.
  3. Create a file named HelloJava.java.
  4. Write the code below.
public class HelloJava {
    public static void main(String[] args) {
        System.out.println("Hello Java from VS Code!");
    }
}

Run using VS Code button

After the Java extension loads, VS Code usually shows a Run option above the main method.

Run using terminal

javac HelloJava.java
java HelloJava
Checkpoint: The terminal should show:
Hello Java from VS Code!

7. Installing and Using IntelliJ IDEA for Java

IntelliJ IDEA is a modern Java IDE. For school-level Java and core Java practice, IntelliJ IDEA Community Edition is usually enough.

Installation steps

1
Search for IntelliJ IDEA download.
2
Download IntelliJ IDEA Community Edition.
3
Install and open IntelliJ IDEA.

Create your first IntelliJ IDEA project

  1. Click New Project.
  2. Select Java.
  3. Choose your installed JDK.
  4. Project name: FirstIntelliJJava.
  5. Create the project.
  6. Right-click src.
  7. Click NewJava Class.
  8. Class name: HelloJava.
public class HelloJava {
    public static void main(String[] args) {
        System.out.println("Hello Java from IntelliJ IDEA!");
    }
}
Checkpoint: Click the green Run triangle near the main method. You should see:
Hello Java from IntelliJ IDEA!

8. The First Program You Should Run in Every IDE

To check whether your IDE is working properly, run this same program in all four IDEs.

public class MyFirstProgram {
    public static void main(String[] args) {
        System.out.println("My Java setup is working.");
        System.out.println("I am ready to learn CBSE Java.");
    }
}
Checkpoint: If the setup is correct, the output should be:
My Java setup is working.
I am ready to learn CBSE Java.

Important rule about file name and class name

In Java, if the class is public, the file name must match the class name.

Class name Correct file name
public class MyFirstProgram MyFirstProgram.java
public class Student Student.java
public class Calculator Calculator.java

9. IDE Comparison for Students

IDE Difficulty Good points Possible confusion
Eclipse Medium Strong Java project support, widely used Workspace and project structure may confuse beginners
NetBeans Easy Simple project creation, beginner-friendly May create packages and templates automatically
VS Code Easy to Medium Lightweight, useful for many languages Needs Java extensions and correct JDK setup
IntelliJ IDEA Easy to Medium Modern, intelligent suggestions, smooth interface Many options can look advanced at first

10. Common Setup Errors and Fixes

Error 1: java is not recognized

This usually means Java is not installed properly or the system PATH is not set.

Fix: Install the JDK again and restart Command Prompt or your computer.

Error 2: javac is not recognized

This usually means the Java compiler is not available in PATH.

Fix: Make sure you installed the JDK, not only the Java Runtime Environment.

Error 3: Class name and file name mismatch

If your class is public class HelloJava, the file must be HelloJava.java.

Error 4: Main method not found

Java needs this method to start the program:

public static void main(String[] args)

Error 5: Package problem

Some IDEs create packages automatically. Do not randomly delete the package line unless you understand the project structure.

11. Practice Tasks

Task 1: Install and verify Java

Install the JDK and run:

java -version
javac -version

Task 2: Run Hello Java

Run a simple HelloJava program in one IDE.

Task 3: Try two IDEs

Run the same program in two IDEs and compare the experience.

Task 4: Create a Scanner program

Create a program that asks for name and age, then prints a greeting.

import java.util.Scanner;

public class StudentIntro {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        System.out.print("Enter your name: ");
        String name = sc.nextLine();

        System.out.print("Enter your age: ");
        int age = sc.nextInt();

        System.out.println("Hello " + name + ". You are " + age + " years old.");

        sc.close();
    }
}

12. Final Recommendation

For CBSE Java learners, do not waste too much time choosing the “perfect” IDE. The main goal is to write Java code regularly.

Best beginner choice
NetBeans or IntelliJ IDEA Community Edition
Best all-purpose editor
Visual Studio Code
Best classic Java IDE
Eclipse
Most important skill
Writing, running, fixing, and improving programs

13. Join the Guided CBSE Java Learning System

Learn at your own pace with structured lessons, coding practice, doubt support, WhatsApp guidance, and Zoom help when needed.

Top