Choosing a Java Editor or IDE — VS Code vs IntelliJ vs Eclipse
Now that Java is installed, you need a tool to write code in. You could use Notepad, but a good IDE (Integrated Development Environment) makes coding dramatically easier — with features like auto-completion, error highlighting, debugging, and one-click run.
The Top 3 Java Editors
| Feature | IntelliJ IDEA Community | VS Code + Java Extensions | Eclipse |
|---|---|---|---|
| Cost | Free | Free | Free |
| Best for | Serious Java development | Lightweight, multi-language | Enterprise Java |
| Auto-complete | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
| Debugging | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
| Speed | Moderate (needs RAM) | Fast and lightweight | Moderate |
| Learning curve | Low | Low | Moderate |
| RAM needed | 4GB+ | 2GB+ | 4GB+ |
| Maven/Gradle | Built-in | Via extensions | Built-in |
| Spring Boot | Excellent (paid Ultimate) | Good with extensions | Good with STS |
Our Recommendation
- Beginners → Start with IntelliJ IDEA Community (best Java experience)
- Already using VS Code → Add the Extension Pack for Java (works great)
- Enterprise work → Eclipse or IntelliJ Ultimate
Option 1: IntelliJ IDEA Community Edition (Recommended)
Install
- Go to https://www.jetbrains.com/idea/download/
- Download the Community Edition (free)
- Install and launch
Create Your First Project
- Click “New Project”
- Set:
- Name:
java-basics - Location: your
java-projectsfolder - Language: Java
- Build system: IntelliJ
- JDK: 21 (select from dropdown or add your installed JDK)
- Name:
- Click “Create”
Create and Run a File
- Right-click
srcfolder → New → Java Class → name itHelloWorld - Type:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello from IntelliJ!");
}
}
- Click the green ▶ Run button next to
main— or pressShift + F10
Output appears in the bottom panel:
Hello from IntelliJ!
Essential IntelliJ Shortcuts
| Shortcut (Mac / Windows) | Action |
|---|---|
Cmd+Shift+F10 / Shift+F10 |
Run current file |
Cmd+B / Ctrl+B |
Go to definition |
Cmd+/ / Ctrl+/ |
Toggle comment |
Cmd+Shift+Enter / Ctrl+Shift+Enter |
Complete statement |
Cmd+Option+L / Ctrl+Alt+L |
Format code |
Cmd+P / Ctrl+P |
Parameter info |
Option 2: VS Code with Java Extensions
Install
- Download VS Code from https://code.visualstudio.com/
- Open VS Code and install the Extension Pack for Java:
- Press
Cmd+Shift+X(Mac) orCtrl+Shift+X(Windows) - Search “Extension Pack for Java”
- Install (by Microsoft)
- Press
This pack includes:
- Language Support for Java (Red Hat)
- Debugger for Java
- Test Runner for Java
- Maven for Java
- Project Manager for Java
Create and Run a File
- Open your
java-projectsfolder in VS Code - Create a file
HelloWorld.java - Type:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello from VS Code!");
}
}
- Click “Run” above the
mainmethod — or pressF5
Option 3: Eclipse IDE
Install
- Go to https://www.eclipse.org/downloads/
- Download Eclipse IDE for Java Developers
- Install and launch
- Choose a workspace folder when prompted
Create and Run a File
- File → New → Java Project → name it
java-basics - Right-click
src→ New → Class → name itHelloWorld, check “public static void main” - Type your
printlninside main - Right-click → Run As → Java Application
Running Java from the Command Line
Regardless of your IDE choice, you should also know how to compile and run from the terminal — it’s useful for understanding what happens behind the scenes:
$ cd ~/java-projects
$ javac HelloWorld.java # Compile → creates HelloWorld.class
$ java HelloWorld # Run → executes the bytecode
Hello from the command line!
The
javaccommand compiles. Thejavacommand runs. No file extension when running (it’sjava HelloWorld, notjava HelloWorld.class).
Summary
| Situation | Recommended Tool |
|---|---|
| Learning Java (beginner) | IntelliJ IDEA Community |
| Already using VS Code | VS Code + Extension Pack for Java |
| Enterprise / legacy projects | Eclipse |
| Quick scripts / testing | Terminal + any text editor |
What’s Next?
Your environment is ready. Time to write your first real Java program: