Choosing an IDE
You can write Java in Notepad, and doing it for your first few programs teaches you what's really going on. But nobody builds real software that way. An IDE (Integrated Development Environment) underlines mistakes as you type, completes long names for you, runs and debugs with one click, and finds any class in a large project in a second. Picking one now saves you hours every week.
What an IDE Does for You
| Feature | Without an IDE | With an IDE |
|---|---|---|
| Spotting mistakes | Run javac, read the error, find the line | Red underline while you type |
| Long names | Type ArrayIndexOutOfBoundsException in full | Type AIO and press Enter |
| Imports | Write every import line yourself | Added automatically |
| Running | javac then java in a terminal | One click or one shortcut |
| Debugging | Add println everywhere | Breakpoints and step-by-step running |
| Renaming | Search and replace, hoping nothing breaks | Rename safely across every file |
The Three Popular Choices
| IntelliJ IDEA | Eclipse | VS Code | |
|---|---|---|---|
| Made by | JetBrains | Eclipse Foundation | Microsoft |
| Cost | Free version, plus a paid Ultimate edition | Free, open source | Free; add the "Extension Pack for Java" |
| Strength | Smart code completion and refactoring; the most common choice in Java jobs | Long history, common in older enterprise projects | Light and fast; good if you also write JavaScript or Python |
| Feels like | A complete Java workshop | A traditional, highly configurable IDE | A text editor with Java added |
| Good for this course? | Yes, recommended | Yes | Yes |
For this course, we recommend IntelliJ IDEA. It's what most Java teams use, its free version covers everything in Core Java, and its hints teach you good habits. If your college or company uses Eclipse, that's fine too: the Java is the same.
Your First Project in IntelliJ IDEA
- Download IntelliJ IDEA from jetbrains.com/idea and install it.
- Choose New Project, select Java, and pick JDK 25 in the JDK drop-down. If it isn't listed, choose "Add JDK..." and select the folder you installed in "Installing the JDK".
- Leave the build system as IntelliJ, tick Add sample code, and click Create.
- Open
Main.javaand click the green Run arrow next tomain.
Replace the sample code with this program and run it again:
public class Main {
public static void main(String[] args) {
String course = "Core Java";
int lessonsDone = 21;
System.out.println("Course: " + course);
System.out.println("Lessons done: " + lessonsDone);
}
}Course: Core Java
Lessons done: 21How it works
- Lines 3 and 4 store a piece of text and a whole number.
- Lines 5 and 6 print them. In the IDE, the output appears in the Run window at the bottom.
Try it yourself: on line 5, delete the closing " after Course: . Notice the red underline appear before you run anything. Then put it back.
Shortcuts Worth Learning First
| Action | IntelliJ IDEA (Windows / Linux) | IntelliJ IDEA (macOS) |
|---|---|---|
| Run | Shift + F10 | Ctrl + R |
| Debug | Shift + F9 | Ctrl + D |
| Complete code | Ctrl + Space | Ctrl + Space |
| Show a fix for the problem under the cursor | Alt + Enter | Option + Enter |
| Format the file | Ctrl + Alt + L | Cmd + Option + L |
| Find any file or class | Shift twice | Shift twice |
Common Mistakes
Picking the wrong JDK in a new project. If the project uses JDK 17, Java 25 features such as compact source files show errors. Check the project's JDK in the project settings.
Accepting every suggestion without reading it. The IDE's fixes are guesses. Read what it's about to change, especially when it offers to change a type.
Never using the terminal. Interviews, servers and build pipelines don't have a Run button. Keep practicing javac and java now and then.
Practice
- Easy: Install IntelliJ IDEA (or your chosen IDE), create a project with JDK 25 and run the
Mainprogram above. - Harder: Type
Systand press Ctrl + Space. Then typesoutand press Tab. What does each one produce? Find one more shortcut likesoutthat saves typing.
Key Takeaways
Was this tutorial helpful?