IntelliJ & Eclipse: Choosing Your Cockpit

IntelliJ & Eclipse: Choosing Your Cockpit in Java: You can write Java in Notepad — but you would be flying a plane with no instruments.

Concept Explanation

You can write Java in Notepad — but you would be flying a plane with no instruments. An IDE (Integrated Development Environment) gives you autocomplete, instant error underlining, one-click run, and a debugger that pauses your program mid-flight.

For Java, three choices dominate:

IDEBest forCost
IntelliJ IDEAThe industry default. Smartest autocomplete.Community edition is free
EclipseLong-standing, common in enterprise and universities.Free
VS CodeLightweight, great if you already live in it.Free

If you have no strong preference, install IntelliJ IDEA Community Edition. It is what most Java teams use.


Comparing Java IDEs in Practice

Choose one tool and stick with it through your first two projects so shortcuts become muscle memory:

  • IntelliJ IDEA Community Edition: Best out-of-the-box ergonomics for Core Java, Maven, Gradle, JUnit, and built-in visual debugging. Free and open-source.
  • VS Code + Extension Pack for Java: Ideal if you already write TypeScript or Python in VS Code and want a lighter editor with Red Hat Java language support and test runner integration.
  • Eclipse IDE for Java Developers: Still common in university coursework and legacy enterprise workspaces; uses its own Workspace -> Project mental model.

Setting Up IntelliJ IDEA (Step by Step)

  1. Install a JDK (Java Development Kit) first (LTS 21 or 17). Note that an IDE is only an editor—it still needs a JDK to compile and execute bytecode.
  2. Download IntelliJ IDEA Community Edition from JetBrains and create a New Project.
  3. Select Java on the left, choose Maven or IntelliJ as the build system, and select your JDK in the JDK dropdown (you can also let IntelliJ download Temurin/OpenJDK right from that menu).
  4. Click Create to generate a standard project layout:
MyProject/
  src/
    main/
      java/     <-- package folders & .java source files live here
  .idea/        <-- local IDE configuration (exclude from Git)
  pom.xml       <-- Maven dependencies & Java compiler version (if using Maven)

First-Day Debugger & Editor Shortcuts

Learning four shortcuts early saves hours of print-statement debugging:

  • Shift + F10 (Windows/Linux) or Ctrl + R (macOS) — run the active main method or test.
  • Click the left gutter next to any line number — toggle a breakpoint, then launch in Debug mode to inspect variable values line by line.
  • Ctrl + Space — trigger smart autocomplete and automatic import statements.
  • Shift + F6 — safely rename a class, method, or variable across every file in your project.
  • Type sout then press Tab — expands to System.out.println(); psvm expands to public static void main(String[] args).

Common Mistakes

  1. No Project SDK selected: If String or System shows red underlines, open File -> Project Structure -> Project and attach your installed JDK.
  2. Writing .java files outside src: Java source roots must be marked as Sources Root (blue folder icon in IntelliJ) or the compiler will ignore them.
  3. Confusing JRE vs JDK: A JRE can run compiled programs but lacks javac. Development requires a full JDK.
  4. Installing Ultimate by mistake: Community Edition covers Core Java, Maven, Gradle, and JUnit without a license.

Best Practices

  • Keep one workspace per module or project: Small isolated projects compile in milliseconds and prevent an error in lesson 2 from blocking lesson 5.
  • Use the formatter (Ctrl + Alt + L): Clean indentation exposes missing braces immediately.
  • Commit .gitignore, never .idea/: Keep IDE window layout out of shared repositories while checking in src/ and pom.xml / build.gradle.

Practice Exercises

  1. The Setup & Verification: Install IntelliJ IDEA Community Edition (or VS Code Java Pack), link JDK 21, and run System.getProperty("java.version") to verify the active runtime.
  2. Live Template Drill: In a new Main class, generate main with psvm and three print lines with sout, then run and format the file with your IDE shortcut.
  3. First Breakpoint: Set a breakpoint on a variable assignment, launch the debugger instead of plain Run, and inspect its value in the Variables panel before stepping over (F8).