Using an IDE
for Java
Learn how to run, debug, and manage Java projects using professional tools like IntelliJ IDEA and Eclipse.
What Is an IDE?
An Integrated Development Environment (IDE) bundles everything a programmer needs into a single application: a code editor, a compiler/build system, a debugger, and a project manager. Instead of switching between separate tools, you work inside one unified workspace.
Why Use an IDE Instead of a Text Editor?
Anatomy of a Java IDE
The Build-Run Cycle
Running a Java Project
What Is Debugging?
Debugging is the process of finding and fixing errors (bugs) in your code. The IDE's debugger lets you pause execution at any line, inspect the values of variables, and step through your code one line at a time to see exactly what happens.
How to Debug a Project
IntelliJ vs Eclipse
| IntelliJ IDEA | Eclipse | |
|---|---|---|
| Run shortcut | Shift+F10 | Ctrl+F11 |
| Debug shortcut | Shift+F9 | F11 |
| Step Over | F8 | F6 |
| Step Into | F7 | F5 |
| Resume | F9 | F8 |
| Set Breakpoint | Click gutter / Ctrl+F8 | Double-click gutter |
| Auto-import | Alt+Enter | Ctrl+Shift+O |
Example: Running a Simple Program
Example: Finding a Bug
Example: Debugging a Loop
| Iteration | i | sum (after) |
|---|---|---|
| 1st | 1 | 1 |
| 2nd | 2 | 3 |
| 3rd | 3 | 6 |
| 4th | 4 | 10 |
| 5th | 5 | 15 |
Debug Controls at a Glance
Understanding Project Structure
Common Mistakes
IDE Workflow Summary
| Task | What You Do | What the IDE Does |
|---|---|---|
| Create project | New Project wizard | Sets up folders, config files |
| Write code | Type in code editor | Auto-completes, highlights errors |
| Run | Click Run / shortcut | Compiles, launches JVM |
| Debug | Set breakpoint, click Debug | Pauses at breakpoint, shows variables |
| Fix errors | Click error, edit code | Jumps to error line, suggests fix |
| Refactor | Rename / extract method | Updates all references automatically |
Question 1 of 5
What is the primary purpose of setting a breakpoint in an IDE?
Question 2 of 5
In IntelliJ IDEA, which keyboard shortcut runs the current project?
Question 3 of 5
What is the difference between Step Over and Step Into during debugging?
Question 4 of 5
A student clicks Run and sees "Error: Main method not found in class MyApp". What is the most likely cause?
Question 5 of 5
Which of the following is not a core component of an IDE?