Set up Eclipse for Java
20 min · Beginner
Showing steps for Windows. They are marked “On Windows” below.
Pick one IDE – you only need one. VS Code, IntelliJ IDEA and Eclipse are alternatives for this step: finish any one of them and the step is done. This guide sets up Eclipse.
Install Eclipse
An IDE (Integrated Development Environment) is an app where you write, run and fix code in one window. It shows mistakes as you type and runs your program with one click.
Eclipse is a free, open-source Java IDE. Many colleges use it in labs. Install the JDK first (previous lesson).
Official downloads
On Windows
Open the Download Eclipse page using the button above.
- Click Download x86_64, then Download on the next page. You get the Eclipse Installer (
.exe). - Double-click the
.exefile and choose Eclipse IDE for Java Developers. - Keep the default folder and click Install. Accept the licenses when asked.
- Click Launch. Next time, open Eclipse from the Start menu.
eclipse-workspace in your home folder) and click Launch. Then close the Welcome tab.Create a new Java project
A project is a folder that holds all the files of one program.
Eclipse can add a file called module-info.java. It turns the project into a module, a way to group a program's code. This first exercise uses a simple project without a module, to keep the setup small. So untick it.
- Click File → New → Java Project.
- Type the project name
HelloApp. - Under Module, untick Create module-info.java file.
- Click Finish.
Create a class and run Hello World
Eclipse can write the main method for you when you create a class.
- In the Package Explorer on the left, open
HelloApp, right-clicksrc→ New → Class. - Type the name
Main. Tick public static void main(String[] args). Click Finish. - Inside
main, typeSystem.out.println("Hello, World!");. Tip: typesysoutand press Ctrl + Space (on Mac too).
On Windows
Now save and run the program.
- Save with Ctrl + S.
- Right-click
Main.java→ Run As → Java Application. Or click the green ▶ in the toolbar, or press Ctrl + F11. - The output appears in the Console view at the bottom.
Common problems and fixes
Most problems come from a module file you did not mean to create, or a missing JDK.
- Errors that mention modules or `module-info` – this exercise is meant to be a project without a module. First check that
module-info.javais in your project by mistake and that the error is about modules. If so, right-clickmodule-info.java→ Delete, then run again. - "Selection does not contain a main type" – the
mainline is missing or misspelled. Check it readspublic static void main(String[] args)and save the file.
On Windows
Problems seen on Windows:
- "JRE not found" or "Unbound classpath container" – open Window → Preferences → Java → Installed JREs → Add… → Standard VM. Choose your real JDK folder, for example
C:\Program Files\Java\jdk-25(Oracle) or the folder insideC:\Program Files\Eclipse Adoptium(Temurin), and tick it.
Example
public class Main { public static void main(String[] args) { System.out.println("Hello, World!"); }}Hello, World!
What this code does
- Eclipse wrote the class and the
mainmethod. You added theSystem.out.printlnline. - If you typed a package name in the class window, Eclipse adds a
packageline at the top. That is fine. - Run As → Java Application compiles and runs the class. The output appears in the Console view.
Next step
Check your understanding
6 quick questions