Java IDEs

Su Suriya Ravichandran Updated 14 Nov 2026
7 min read ·Lesson 31 of 133

An IDE (Integrated Development Environment) combines a code editor, compiler, debugger, build-tool integration, and project management in one application. Java can be written in any text editor and compiled with javac, but Java's static typing gives IDEs complete knowledge of your code, so a Java IDE can do far more than highlight syntax: it understands every type, method, and reference in the project.

What an IDE Does for Java

FeatureWhat it means in practice
Error highlighting as you typeType mismatches, missing imports, and undefined methods are underlined before you compile
Code completionTyping name. lists every method available on a String, with parameter types
Automatic importsUsing List offers to add import java.util.List;
NavigationJump to where a class or method is defined; list every place it is used
RefactoringRename a method and every call across the project updates safely; extract code into a new method
DebuggerPause at a breakpoint, inspect variables, step line by line
Build-tool integrationOpens Maven and Gradle projects, downloads dependencies, runs tests
Code generationGenerates constructors, getters, equals, hashCode, and toString

Refactoring is where an IDE is most valuable. Renaming a method by find-and-replace in a text editor also renames unrelated methods and strings with the same name. An IDE renames exactly the references to that method, because it resolves every reference through the type system.

The Main Java IDEs

IntelliJ IDEA (JetBrains)

The most widely used Java IDE. Known for strong code analysis, refactoring, and smart completion. Its free edition covers everything in this tutorial; paid features add support for enterprise frameworks, databases, and web tooling. JetBrains has restructured its editions over time, so check jetbrains.com for the current free and paid options.

  • Can download and manage JDKs from inside the IDE (File → Project Structure → SDKs).
  • Built-in Maven and Gradle support.
  • Android Studio, Google's official Android IDE, is built on IntelliJ IDEA.

Visual Studio Code with the Extension Pack for Java

VS Code is a lightweight, general-purpose editor. Java support comes from Microsoft's Extension Pack for Java, which bundles language support (powered by the Eclipse JDT language server), a debugger, a test runner, Maven integration, and a project manager.

  • Good choice if you already use VS Code for other languages.
  • Lighter on memory than full IDEs; suited to small and medium projects.
  • Single .java files can be run directly with a Run button.

Eclipse IDE

A long-established, free, open-source IDE from the Eclipse Foundation. Download the Eclipse IDE for Java Developers package.

  • Highly extensible through plugins.
  • Uses its own incremental compiler, which reports errors as you type even in very large codebases.
  • Common in enterprises and universities.

Apache NetBeans

A free, open-source IDE from the Apache Software Foundation, with Java SE, Maven, and Gradle support out of the box. Its simple project setup and built-in GUI builder for Swing make it popular in teaching.

Comparison

IntelliJ IDEAVS Code + JavaEclipseNetBeans
CostFree edition plus paid tiersFreeFreeFree
Resource usageHighLow to moderateModerateModerate
Refactoring depthVery strongGoodStrongGood
Setup effortLowInstall extension packLowLow
Best forProfessional Java and Kotlin workPolyglot developers, lighter projectsPlugin-heavy and legacy enterprise setupsTeaching, Swing GUIs

All four compile and run every example in this tutorial. For a beginner with no prior preference, IntelliJ IDEA's free edition or VS Code with the Extension Pack for Java are the most common starting points.

Creating and Running a First Project

IntelliJ IDEA

  1. New Project → choose Java.
  2. Select a JDK (or let IntelliJ download one).
  3. Build system: IntelliJ for a simple project, or Maven/Gradle for one that uses a build tool.
  4. Optionally check Add sample code, then click Create.
  5. In src, right-click → New → Java Class → name it Main.
  6. Inside the class type psvm and press Tab to generate public static void main(String[] args). Inside it type sout and press Tab to generate System.out.println();.
  7. Click the green Run arrow next to the main method.

VS Code

  1. Install the JDK, then install the Extension Pack for Java from the Extensions view.
  2. Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) → Java: Create Java Project → No build tools (or Maven/Gradle).
  3. Open src/App.java and click Run above main.

For a single file, simply open any .java file containing a main method; the Run link appears without creating a project.

Eclipse

  1. File → New → Java Project, enter a name, select a JRE (JDK), and click Finish.
  2. Right-click src → New → Class, enter a name, and check public static void main(String[] args).
  3. Type sysout and press Ctrl+Space to expand it to System.out.println();.
  4. Run → Run As → Java Application.

Using the Debugger

The debugger lets you pause a running program and inspect its state, which is far more informative than adding println statements.

public class Totals {
    public static void main(String[] args) {
        int[] prices = {120, 80, 45};
        int total = 0;
        for (int i = 0; i <= prices.length; i++) {   // bug: <= instead of <
            total += prices[i];
        }
        System.out.println(total);
    }
}

This program throws ArrayIndexOutOfBoundsException. To investigate:

  1. Click in the gutter (left margin) next to the line total += prices[i]; to set a breakpoint.
  2. Start the program in Debug mode (the bug icon) rather than Run.
  3. Execution pauses at the breakpoint. The Variables panel shows prices, total, and i.
  4. Use Step Over to run one line at a time. Watch i increase: 0, 1, 2, then 3, at which point prices[3] fails.

The cause, i <= prices.length, becomes obvious when you see i reach 3 for a three-element array.

Debugger actionEffect
Step OverRun the current line, including any method it calls, and stop at the next line
Step IntoEnter the method called on the current line
Step OutFinish the current method and stop in its caller
ResumeRun until the next breakpoint
Conditional breakpointPause only when an expression is true, e.g. i == 2
Evaluate expressionCompute any expression using the current variable values

Useful Shortcuts and Generators

Every IDE can generate common boilerplate. Given a class with fields:

public class Book {
    private String title;
    private String author;
    private int year;
}

Use Generate (IntelliJ: Alt+Insert on Windows/Linux, Cmd+N on macOS; Eclipse: Source menu) to create a constructor, getters and setters, equals/hashCode, and toString. These methods are easy to write incorrectly by hand, especially equals and hashCode, and the IDE writes them consistently. For a pure data holder, a record (covered in the OOP section) removes the need for most of this generated code entirely.

Other actions worth learning early:

  • Quick fix (IntelliJ Alt+Enter, Eclipse Ctrl+1, VS Code Ctrl+.): offers a fix for the error or warning under the cursor, such as adding an import or creating a missing method.
  • Reformat code: applies consistent indentation and spacing to the file.
  • Rename (IntelliJ Shift+F6, Eclipse Alt+Shift+R, VS Code F2): safe, project-wide renaming.
  • Find usages: lists every reference to the selected class, method, or field.

IDE and Command Line Together

An IDE compiles and runs code using the same JDK tools you use from a terminal. Knowing both matters: build servers, Docker images, and production systems run Java from the command line, with no IDE involved. The following lessons cover the JDK, JRE, JVM, compiler, and the javac and java commands, so that what the IDE does behind its Run button is understood rather than hidden.

When a project uses Maven or Gradle, open the project's pom.xml or build.gradle file in the IDE rather than creating a new IDE project. The IDE then reads dependencies and settings from the build file, so the project builds the same way inside and outside the IDE.

0 Comments

Reviewed before they appear

No comments yet.

Java
Java Introduction Java Features Java Syntax Java Comments Java Statements Java Output Java Variables Java Data Types Java Type Casting Java Operators Java Strings Java Numbers Java Math Java Booleans Java User Input Java Conditions Java If Else Java Switch Java While Loop Java For Loop Java Break Java Continue Java Arrays Java Methods Java Parameters Java Return Values Java Scope Java Recursion Install Java Install JDK Java IDEs Java JDK Java JRE Java JVM Java Compiler Java File Compile Java Run Java JShell Basics Java Packages Java OOP Java Classes Java Objects Class Methods Constructors Constructor Overload this Keyword static Keyword final Keyword Encapsulation Inheritance Polymorphism Abstraction Access Modifiers super Keyword Method Overload Method Override Instanceof Operator Nested Classes Inner Classes Anonymous Classes Enums Records Array Basics Array Length Loop Arrays Multidimensional Arrays Array Copy Array Sorting Array Search ArrayList LinkedList HashSet TreeSet HashMap TreeMap Queue Interface Deque Interface Stack Class Iterator List Interface Set Interface Map Interface Collections Class Comparable Comparator Generics Basics Generic Classes Generic Methods Wildcards String Basics String Length String Methods String Concatenation String Compare String Search String Replace String Split String Format StringBuilder StringBuffer Text Blocks Regular Expressions Number Types Integer Class Float Class Double Class BigInteger BigDecimal Math Class Random Numbers Number Format Date Basics LocalDate LocalTime LocalDateTime ZonedDateTime Date Formatting Date Parsing Period Class Duration Class Java Instant Class Java Exception Basics Java try...catch Java Multiple Catch Blocks Java finally Block Java throw Keyword Java throws Keyword Java Checked Exceptions Java Unchecked Exceptions Java Custom Exceptions Java try-with-resources Java Exception Chaining
Ask about this post
AI Ask about this post

Ask questions about Java IDEs and get answers drawn from it.

Signed-in readers only.