Install IDE¶
1. What is an IDE¶
An IDE (Integrated Development Environment) is an all-in-one coding environment that combines:
- Code editor with syntax highlighting and autocomplete
- Integrated compiler/runner — press one button to build and run your program
- Debugger — pause execution at any line to inspect variable values
- Project management — organize files, libraries, and build configuration
Writing Java without an IDE is possible, but an IDE catches errors as you type (before you even run the code), saving hours every day.
2. Which IDE to choose?¶
| IDE | Best for | Free? |
|---|---|---|
| IntelliJ IDEA Community | Beginners and professional developers | ✓ |
| Eclipse | Enterprise environments, legacy projects | ✓ |
| VS Code + Java Extension Pack | Developers already familiar with VS Code | ✓ |
| Apache NetBeans | Beginners, students — friendly UI, Maven built-in | ✓ |
Recommendation for beginners
Choose IntelliJ IDEA Community Edition. It is the most popular Java IDE, has the most beginner-friendly interface, and most Java learning resources use IntelliJ. You can install other IDEs later once you're comfortable.
3. Install IntelliJ IDEA Community Edition¶
Step 1 — Download IntelliJ IDEA¶
- Open a browser and go to:
https://www.jetbrains.com/idea/download/ - Scroll down to find the Community Edition section (the right panel, labeled "For JVM and Android development").
- Click the black Download button under Community Edition (not Ultimate).
- The
.exefile is downloaded (~850 MB).
Step 2 — Run the installer¶
- Open the downloaded
.exefile from Downloads. - Click Yes when prompted to allow changes to the computer.
- Welcome screen → click Next.
- Choose installation directory (keep the default) → click Next.
- On the Installation Options screen, check:
- ✅ Create Desktop Shortcut — desktop icon for quick access
- ✅ Add "Open Folder as Project" — right-click any folder to open in IntelliJ
- ✅ Add launchers dir to the PATH — run IntelliJ from the terminal if needed
.java— optional (opens.javafiles in IntelliJ when double-clicked)
- Click Next → Install → wait 1–2 minutes → click Finish.
Step 3 — Open IntelliJ for the first time¶
- Double-click the IntelliJ IDEA icon on the desktop (or search in the Start Menu).
- The Import Settings screen asks if you want to import old settings — select Do not import settings → OK.
- The Welcome to IntelliJ IDEA screen appears — this is the main start screen.
Option 1 — Download from JetBrains (recommended)¶
- Go to https://www.jetbrains.com/idea/download/
- Scroll to Community Edition, choose the correct build for your chip:
- Apple Silicon (M1/M2/M3): download
.dmg (Apple Silicon) - Intel: download
.dmg (Intel)
- Apple Silicon (M1/M2/M3): download
- Open the
.dmgfile, drag the IntelliJ IDEA CE icon into Applications. - Open Finder → Applications → IntelliJ IDEA CE to launch.
Option 2 — Install via Homebrew¶
Option 1 — Download .tar.gz¶
- Go to https://www.jetbrains.com/idea/download/
- Scroll to Community Edition, download the
.tar.gzfile. -
Extract and run:
-
Inside IntelliJ, go to Tools → Create Desktop Entry to create an application menu shortcut.
Option 2 — Snap (Ubuntu)¶
Verify IntelliJ works¶
After opening IntelliJ IDEA for the first time:
- Click New Project on the Welcome screen.
- Select Java in the left column, ensure JDK shows
21(if not, click the dropdown and choose Add JDK → point to the JDK 21 directory). - Click Create → IntelliJ creates a sample project.
- Open
Main.javain the left file tree → click the green ▶ Run button → the program runs and output appears at the bottom.
Success if
The Run panel at the bottom shows Hello, World! (or the sample program's output). IntelliJ is correctly connected to JDK 21.
4. Install Eclipse IDE¶
Eclipse is a long-established IDE that remains widely used in enterprise Java environments.
Step 1 — Download Eclipse Installer¶
- Go to https://www.eclipse.org/downloads/
- Click Download x86_64 to download the Eclipse Installer (~70 MB).
Step 2 — Run Eclipse Installer¶
- Open the downloaded
.exefile. - The Eclipse type selection screen appears → choose Eclipse IDE for Java Developers.
- Check the JVM field — Eclipse should auto-detect JDK 21. If not, click the field and point it to the JDK 21 directory.
- Click Install → accept the License → wait for the download (~400 MB) → click Launch.
- Go to https://www.eclipse.org/downloads/, download the Eclipse Installer for macOS.
- Open the
.dmgfile, run the installer, select Eclipse IDE for Java Developers. - Alternatively:
brew install --cask eclipse-java
Create your first project in Eclipse¶
- Open Eclipse, choose a Workspace folder (where your projects will be saved) → click Launch.
- Go to File → New → Java Project.
- Name the project (e.g.
HelloWorld) → ensure JRE showsJavaSE-21→ click Finish. - Right-click the
srcfolder → New → Class. - Name it
Main, check public static void main(String[] args) → click Finish. - Click the ▶ Run button (or
Ctrl + F11) to run.
5. Install VS Code + Java Extension Pack¶
VS Code is a lightweight editor — less resource-heavy than IntelliJ or Eclipse. To write Java in VS Code you need to install additional extensions.
Step 1 — Install VS Code¶
- Go to https://code.visualstudio.com/, click Download.
- Run the installer and follow the on-screen steps.
Step 2 — Install the Java Extension Pack¶
- Open VS Code.
- Press
Ctrl + Shift + X(Windows) orCmd + Shift + X(macOS) to open Extensions. - In the search box, type:
Extension Pack for Java - Find the extension by Microsoft (blue logo) → click Install.
This pack includes 6 components: - Language Support for Java — syntax highlighting, autocomplete, error detection - Debugger for Java — integrated debugger - Test Runner for Java — run JUnit tests - Maven for Java — Maven project support - Project Manager for Java — project navigation - IntelliCode — AI-assisted code suggestions
Step 3 — Open a Java project¶
- Go to File → Open Folder, select your project directory.
- Open a
.javafile — VS Code automatically activates the Java extension. - Click the ▶ Run button that appears above the
mainmethod to run the program.
VS Code requires JDK to be installed first
VS Code does not manage JDK itself — it reads the JAVA_HOME variable or auto-detects the JDK from PATH. Make sure JDK 21 is installed and JAVA_HOME is set correctly before opening VS Code.
6. Install Apache NetBeans¶
NetBeans is an open-source IDE developed by the Apache Software Foundation. It is widely used in university Java courses thanks to its straightforward UI, built-in Maven support, and zero configuration required to get started.
Step 1 — Download NetBeans¶
- Open a browser and go to:
https://netbeans.apache.org/front/main/download/ - Select the latest release (e.g. Apache NetBeans 25).
- Download the Windows Installer (
.exe, ~600 MB).
Step 2 — Run the installer¶
- Open the downloaded
.exefile. - Click Next on the welcome screen.
- Choose the installation directory (keep the default) → Next.
- Verify the JDK field points to JDK 21 → Next.
- Click Install → wait for completion → click Finish.
Step 3 — Open NetBeans for the first time¶
- Find Apache NetBeans IDE in the Start Menu or double-click the desktop icon.
- First launch may take 30–60 seconds.
Option 1 — Download the installer¶
- Go to https://netbeans.apache.org/front/main/download/, download the macOS Installer (
.dmg). - Open the
.dmgfile, drag Apache NetBeans to Applications.
Option 2 — Install via Homebrew¶
Option 1 — Download .sh installer¶
- Go to https://netbeans.apache.org/front/main/download/, download the Linux Installer (
.sh). -
Open a terminal, make it executable and run:
-
Follow the on-screen instructions.
Option 2 — Snap (Ubuntu)¶
Create your first project in NetBeans¶
- Click New Project (or File → New Project).
- Select Java with Maven → Java Application → click Next.
- Enter a project name (e.g.
HelloWorld) → click Finish. - NetBeans creates
App.javain thesrcdirectory. - Click ▶ Run Project (or press
F6) to run.
Success if
The Output panel at the bottom shows the program's output. NetBeans is correctly connected to JDK 21.
7. Quick Comparison¶
| Feature | IntelliJ IDEA CE | Eclipse | VS Code | NetBeans |
|---|---|---|---|---|
| Startup speed | Slower | Medium | Fast | Medium |
| RAM usage | ~500–800 MB | ~400–600 MB | ~200–400 MB | ~300–500 MB |
| Smart autocomplete | ★★★★★ | ★★★ | ★★★★ | ★★★★ |
| Maven/Gradle integration | Excellent | Good | Good | Good (Maven built-in) |
| Community popularity | Very high | High (enterprise) | High (frontend) | Medium (academic) |
| Plugins/Extensions | Rich | Rich | Rich | Moderate |
8. Keyboard shortcuts to learn now¶
| Action | Windows / Linux | macOS |
|---|---|---|
| Run program | Shift + F10 |
Ctrl + R |
| Debug program | Shift + F9 |
Ctrl + D |
| Autocomplete suggestions | Ctrl + Space |
Ctrl + Space |
| Comment/uncomment line | Ctrl + / |
Cmd + / |
| Search everything | Shift Shift |
Shift Shift |
| Quick fix | Alt + Enter |
Option + Enter |
| Auto-format code | Ctrl + Alt + L |
Cmd + Option + L |
| Action | Windows / Linux | macOS |
|---|---|---|
| Run program | Ctrl + F11 |
Cmd + F11 |
| Debug program | F11 |
F11 |
| Autocomplete suggestions | Ctrl + Space |
Ctrl + Space |
| Comment/uncomment line | Ctrl + / |
Cmd + / |
| Auto-format code | Ctrl + Shift + F |
Cmd + Shift + F |
| Auto-import | Ctrl + Shift + O |
Cmd + Shift + O |
| Action | Windows / Linux | macOS |
|---|---|---|
| Run/Debug program | F5 |
F5 |
| Autocomplete suggestions | Ctrl + Space |
Ctrl + Space |
| Comment/uncomment line | Ctrl + / |
Cmd + / |
| Auto-format code | Shift + Alt + F |
Shift + Option + F |
| Open Command Palette | Ctrl + Shift + P |
Cmd + Shift + P |
| Action | Windows / Linux | macOS |
|---|---|---|
| Run project | F6 |
F6 |
| Debug project | F5 |
F5 |
| Autocomplete suggestions | Ctrl + Space |
Ctrl + Space |
| Comment/uncomment line | Ctrl + / |
Cmd + / |
| Auto-format code | Alt + Shift + F |
Option + Shift + F |
| Fix imports automatically | Ctrl + Shift + I |
Cmd + Shift + I |
| Build project | F11 |
F11 |
9. Troubleshooting¶
IntelliJ does not recognize the JDK¶
Symptom: IntelliJ shows "No JDK configured" or all Java code is underlined in red.
Fix:
1. Go to File → Project Structure (Ctrl + Alt + Shift + S).
2. Select Project in the left column.
3. In the SDK field, click Add SDK → JDK → point it to the JDK 21 directory.
VS Code can't find Java¶
Symptom: Message says "Java runtime could not be located".
Fix:
Open VS Code Settings (Ctrl + ,), search for java.jdt.ls.java.home, and set the value to the JDK 21 path (e.g. C:\Program Files\Eclipse Adoptium\jdk-21.0.3.9-hotspot).
Eclipse runs very slowly (Windows)¶
Cause: Eclipse needs more memory.
Fix: Open the eclipse.ini file in the Eclipse installation folder, find the -Xmx line and increase it to -Xmx2g (2 GB maximum RAM).
NetBeans does not recognize the JDK¶
Symptom: NetBeans shows "No Java Platform defined" or cannot build any project.
Fix: 1. Go to Tools → Java Platforms. 2. Click Add Platform → select Java Standard Edition → Next. 3. Point to the JDK 21 directory → Next → Finish.
NetBeans starts very slowly¶
Cause: The default memory allocation for NetBeans is low.
Fix: Open the netbeans.conf file in the installation directory (usually C:\Program Files\NetBeans-25\netbeans\etc\), find the netbeans_default_options line, and append -J-Xmx2g to the end of the options string.
With your IDE working correctly, the next step is Terminal Basics — learning to use the command line to run Java without an IDE.