JAVA • GETTING STARTED AND TOOLING

Using IDE — Use an IDE (IntelliJ/Eclipse) to run and debug a project (conceptual steps)

Learn how modern development environments help you write, run, and debug Java programs efficiently.

Historical Context & Motivation

Before modern tools existed, programmers wrote code in basic text editors, then had to switch to a separate terminal window to compile and run their programs. Tracking down bugs meant adding print statements everywhere and painstakingly reading through output logs. This workflow was slow, error-prone, and frustrating. The need for a single tool that could handle writing, compiling, running, and debugging code led to the creation of the Integrated Development Environment (IDE) — a software application that bundles all these tasks into one unified workspace.

1983
Turbo Pascal Released
Borland released Turbo Pascal, one of the first widely-used IDEs. It combined a code editor and compiler in a single program, showing developers how much faster coding could be.
1995
Java Arrives
Sun Microsystems launched the Java programming language. Its popularity created demand for Java-specific development tools that could understand Java's structure and syntax.
2001
Eclipse IDE Launched
IBM open-sourced Eclipse, a powerful free IDE for Java. Its plugin architecture allowed the community to extend its capabilities, and it quickly became a classroom and industry standard.
2001
IntelliJ IDEA Released
JetBrains released IntelliJ IDEA, introducing advanced features like intelligent code completion. Its Community Edition later became free and open-source, making it accessible to students.
2020s
Modern IDE Era
Today's IDEs include AI-powered suggestions, integrated version control, built-in terminal windows, and sophisticated visual debuggers — making coding more accessible than ever.

The central question this lesson addresses is straightforward: how do you use an IDE to create, run, and debug a Java project? Understanding the conceptual steps behind this process will prepare you to work confidently in IntelliJ IDEA, Eclipse, or any similar environment.

Core Principles of an IDE

An IDE is more than just a text editor. It integrates several essential tools into a single application so you can focus on solving problems rather than juggling separate programs. Every major Java IDE — whether IntelliJ IDEA, Eclipse, or another — is built around the same core principles.

1

Code Editor with Syntax Highlighting

The editor color-codes your Java keywords, strings, and variables so you can read code at a glance. It also underlines errors in real time, much like a spell-checker in a word processor.
2

Project Structure & File Management

IDEs organize your source files, libraries, and resources into a project. A project panel on the side lets you browse folders and quickly navigate between classes.
3

Build & Run Integration

With a single click or keyboard shortcut, the IDE compiles your Java source code into bytecode and runs it on the JVM. You never need to type javac or java commands manually.
4

Debugger

The debugger lets you pause your running program at any line (using breakpoints), inspect variable values, and step through your code one line at a time to find and fix bugs.
5

Console / Output Panel

The console panel displays everything your program prints with System.out.println() and also shows compiler error messages, all within the IDE window.
✦ KEY TAKEAWAY
Think of an IDE like a fully equipped workshop. A carpenter could keep their saw in the garage, nails in the basement, and workbench in the backyard — but having everything in one room makes building furniture far more efficient. An IDE is your all-in-one coding workshop: editor, compiler, runner, and debugger together under one roof.

Visual Explanation — The IDE Workflow

The following diagram shows the complete workflow of using an IDE to write, run, and debug a Java project. Each stage feeds into the next, and the IDE keeps you inside a single window throughout the entire process.

The IDE workflow starts with creating a project (step 1), writing code (step 2), compiling (step 3), and running (step 4). When a bug appears, you set breakpoints (step 6), enter debug mode (step 7), fix the code (step 8), and repeat until the program behaves correctly.

Notice the loop at the bottom of the diagram. Software development is inherently iterative — you write code, test it, find issues, fix them, and test again. The IDE makes every step of that loop faster because you never leave the application. The compile step often happens automatically in modern IDEs, and the debugger replaces the tedious process of scattering System.out.println() calls throughout your code.

How the IDE Works Under the Hood

When you press the Run button in IntelliJ or Eclipse, the IDE performs several steps behind the scenes. Understanding these steps helps you troubleshoot problems and appreciate what the tool is doing for you.

Step A — Compilation

The IDE invokes the Java compiler (javac) on your .java source files. The compiler translates your human-readable Java code into bytecode — a set of instructions stored in .class files. If there are syntax errors (like a missing semicolon), the IDE catches them here and highlights the exact line in red.

Step B — Execution

After compilation succeeds, the IDE launches the Java Virtual Machine (JVM) and tells it to execute the bytecode starting from the public static void main(String[] args) method of your specified class. The console panel inside the IDE captures all standard output and error streams, so you see the results instantly.

Step C — Debugging

When you run in debug mode, the IDE connects to the JVM through a special debugging protocol called JDWP (Java Debug Wire Protocol). This connection lets the IDE pause execution at breakpoints, read the values of all variables in memory, and let you control execution one line at a time. Think of it as a remote control for your running program.

Your .java source file is compiled by javac into bytecode (.class), which the JVM then executes. When debugging, the IDE connects to the JVM via JDWP (dashed pink line) to control and inspect the running program.

Key IDE Actions — A Detailed Breakdown

Now let's break down the most important actions you perform inside an IDE when working on a Java project. These steps apply whether you use IntelliJ IDEA or Eclipse — the buttons may look slightly different, but the concepts are identical.

Common IDE actions and their keyboard shortcuts in IntelliJ IDEA and Eclipse
ActionWhat It DoesIntelliJ ShortcutEclipse Shortcut
Create ProjectSets up a folder structure with src/ directory, configures the JDK versionFile → New → ProjectFile → New → Java Project
Create ClassCreates a new .java file with a class skeleton already typed for youRight-click src → New → Java ClassRight-click src → New → Class
RunCompiles and executes your program, showing output in the consoleShift + F10Ctrl + F11
Set BreakpointMarks a line where execution will pause during debug modeClick the gutter (left margin)Double-click the gutter
DebugRuns the program but pauses at breakpoints so you can inspect stateShift + F9F11
Step OverExecutes the current line and moves to the next lineF8F6
Step IntoIf the current line calls a method, jumps inside that method to trace its logicF7F5
ResumeContinues execution until the next breakpoint or the program endsF9F8
💡 Pro Tip
Learning keyboard shortcuts will dramatically speed up your workflow. Start by memorizing the Run and Debug shortcuts for your chosen IDE, then gradually learn Step Over and Step Into. You'll be debugging like a pro in no time.

Worked Example — Running & Debugging a Java Program

Let's walk through a realistic scenario. Suppose you have a program that is supposed to calculate the average of three quiz scores, but it's giving the wrong answer. We'll use the IDE to find and fix the bug.

Debugging a Faulty Average Calculator
1
Step 1 — Create the Project and ClassOpen your IDE (IntelliJ or Eclipse). Go to File → New → Project, name it QuizAverage, and select the JDK version. Then right-click the src folder and create a new Java class called Main.
Project structure created with Main.java ready for editing.
2
Step 2 — Write the CodeType the following code in the editor. Notice the bug — can you spot it? int a = 85, b = 90, c = 78; int average = a + b + c / 3; System.out.println("Average: " + average); The code compiles successfully because there are no syntax errors — the bug is a logic error.
Code compiles without errors but has a logic bug (operator precedence issue).
3
Step 3 — Run the ProgramPress Run (Shift+F10 in IntelliJ). The console outputs Average: 201. The expected average of 85, 90, and 78 is 84 — so 201 is clearly wrong. Time to debug!
Output: 201 (incorrect — expected ≈ 84)
4
Step 4 — Set a Breakpoint and Start DebuggingClick in the gutter next to the line int average = a + b + c / 3; to set a breakpoint (a red dot appears). Now press Debug (Shift+F9 in IntelliJ). The program pauses right before executing that line.
Execution pauses at the breakpoint. Variables panel shows a = 85, b = 90, c = 78.
5
Step 5 — Step Over and InspectPress Step Over (F8 in IntelliJ) to execute the line. Now look at the Variables panel — it shows average = 201. The problem is clear: Java evaluates c / 3 first (78 / 3 = 26 in integer division), then adds a + b + 26 = 201. You need parentheses: (a + b + c) / 3.
Bug found: missing parentheses caused incorrect order of operations.
6
Step 6 — Fix and Re-runStop the debugger, change the line to int average = (a + b + c) / 3;, and press Run again. The console now shows Average: 84. Bug fixed!
Output: 84 ✓ — Program now works correctly.

IntelliJ IDEA vs. Eclipse — Strengths & Limitations

Both IntelliJ IDEA (Community Edition) and Eclipse are free, powerful, and widely used for Java development. Choosing between them is partly a matter of personal preference, but there are meaningful differences worth understanding.

Feature comparison between IntelliJ IDEA Community Edition and Eclipse IDE
FeatureIntelliJ IDEA (Community)Eclipse
Setup ExperienceClean installer; guided project setup wizard makes getting started easyRequires choosing a "workspace" on first launch, which can confuse beginners
Code CompletionExcellent context-aware suggestions; often predicts what you want to typeGood basic completion; requires plugins for advanced suggestions
DebuggerIntuitive debug panel with inline variable display directly in the editorPowerful debugger with a separate "Debug Perspective" layout
Plugin EcosystemCurated plugin marketplace; most features built in out of the boxMassive plugin ecosystem; highly customizable but can be overwhelming
PerformanceUses more RAM; needs a reasonably modern computer (4+ GB RAM recommended)Generally lighter on resources; runs adequately on older hardware
CostCommunity Edition is free; Ultimate Edition requires a paid licenseCompletely free and open source
✦ KEY TAKEAWAY
Choosing an IDE is like choosing between two smartphones — both make calls, send texts, and run apps. One might have a slightly better camera, the other a longer battery life. The important thing is that the core skills you learn transfer directly from one IDE to another. Master the concepts — project creation, running, breakpoints, stepping — and you can switch tools anytime.

Connection to Advanced Development Practices

The basic IDE skills you're learning now form the foundation for more advanced development practices that professional software engineers use every day. As you grow as a programmer, you'll encounter tools and workflows that build directly on these concepts.

How today's IDE skills connect to professional software engineering practices
What You Learn NowWhat It Leads To
Running a single-file projectBuild systems like Maven or Gradle that manage large multi-file projects with dozens of dependencies
Setting breakpoints to find bugsConditional breakpoints, watch expressions, and remote debugging of applications running on servers
Reading console outputLogging frameworks (Log4j, SLF4J) that write structured logs for production applications
Manually testing by running the programUnit testing with JUnit, where the IDE runs automated tests and reports pass/fail results
Saving files locally on your computerVersion control with Git (integrated into both IntelliJ and Eclipse), enabling collaboration with teams

The most important thing to recognize is that mastering the debug cycle now saves you hundreds of hours later. Professional developers spend roughly 50% of their time debugging and reading code, not writing it. The sooner you become comfortable with breakpoints, stepping, and variable inspection, the more productive you'll be in every future computer science course and project.

Practice Problems

PROBLEM 1 — CONCEPTUAL
What is the difference between a syntax error and a logic error? At which stage of the IDE workflow (compile or run) would each type of error be detected?
PROBLEM 2 — BASIC
You want to pause your Java program at line 12 to see the value of a variable called total. List the three conceptual steps you would take in the IDE to accomplish this.
PROBLEM 3 — INTERMEDIATE
A student writes a for loop that should print the numbers 1 through 5, but it prints 0 through 4 instead. The code is: for (int i = 0; i < 5; i++) { System.out.println(i); }. Describe how you would use the debugger's Step Over feature to diagnose this problem and what fix you would apply.
PROBLEM 4 — APPLIED
You're building a grade calculator that reads five test scores from user input, calculates the average, and assigns a letter grade. The program compiles and runs, but it always outputs "F" regardless of the scores entered. Describe a systematic debugging strategy using IDE tools to isolate the bug. What specific debugger features would you use at each stage?
PROBLEM 5 — CRITICAL THINKING
Some programmers argue that using System.out.println() statements for debugging is sufficient and that learning the IDE debugger is unnecessary. Write a thoughtful argument for why the visual debugger is superior for complex programs. Include at least two specific scenarios where println-debugging would be significantly harder than using breakpoints and variable inspection.

Lesson Summary

An Integrated Development Environment (IDE) like IntelliJ IDEA or Eclipse combines a code editor, compiler, runner, and debugger into a single application. The typical workflow follows a clear sequence: create a project, write code in the editor with syntax highlighting and autocomplete, compile and run with a single click, and review output in the console panel.

When bugs arise, the debugger is your most powerful tool. Set breakpoints by clicking the gutter to pause execution at specific lines, then use Step Over to execute one line at a time and Step Into to trace method calls. The Variables panel lets you inspect every variable's value at each pause, making it far easier to find logic errors than using println statements. These skills transfer across any IDE and form the foundation for professional software development.

Varsity Tutors • Java • Using IDE — Use an IDE (IntelliJ/Eclipse) to run and debug a project (conceptual steps)