Sunday, January 25, 2026
HomeTech PostHow to run first Java Program using Eclipse IDE

How to run first Java Program using Eclipse IDE

Here’s a simple, beginner-friendly guide to run your first Java program using Eclipse IDE ☕💻


1. Install Required Software

Before starting, make sure you have:

  • JDK (Java Development Kit) installed
  • Eclipse IDE for Java Developers

👉 If Eclipse opens without errors and lets you create a Java project, your JDK is already configured.


2. Open Eclipse IDE

https://studyopedia.com/wp-content/uploads/2017/08/Eclipse-IDE-Welcome-Screen.png?utm_source=chatgpt.com
https://pages.cs.wisc.edu/~gerald/cs302/assignments/a0/images/workspace_launcher.png?utm_source=chatgpt.com
  1. Launch Eclipse
  2. Select a Workspace (a folder where your projects will be stored)
  3. Click Launch

3. Create a New Java Project

https://pages.cs.wisc.edu/~dakoop/cs302/assignments/assignment0/EclipseTutorial/images/NewJavaProjectWizard.png?utm_source=chatgpt.com
https://i.sstatic.net/75ClA.jpg?utm_source=chatgpt.com
  1. Go to File → New → Java Project
  2. Enter Project Name (example: FirstJavaProgram)
  3. Click Finish

📁 You’ll see the project appear in the Package Explorer.


4. Create a Java Class

https://studyopedia.com/wp-content/uploads/2017/09/Create-New-Java-Class-in-Eclipse.png?utm_source=chatgpt.com
https://help.eclipse.org/latest/topic/org.eclipse.jdt.doc.user/gettingStarted/images/wiz_new_class_dialog_superchecked.png?utm_source=chatgpt.com
  1. Right-click on srcNew → Class
  2. Enter:
    • Package name (optional): com.example
    • Class name: HelloWorld
  3. ✅ Check public static void main(String[] args)
  4. Click Finish

5. Write Your First Java Program

Eclipse will auto-generate code. Replace or confirm it looks like this:

package com.example;

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}

6. Run the Java Program

https://i.sstatic.net/saMdd.png?utm_source=chatgpt.com
https://mathcenter.oxford.emory.edu/site/images/notes/16-04.png?utm_source=chatgpt.com

Method 1 (Recommended for beginners)

  • Right-click anywhere in the editor
  • Select Run As → Java Application

Method 2

  • Click the ▶ Run button on the toolbar

7. View Output in Console

At the bottom of Eclipse, you’ll see the Console showing:

Hello, World!

🎉 Congratulations! You’ve successfully run your first Java program.


Common Beginner Issues (Quick Fixes)

  • No JDK found → Install JDK and set JAVA_HOME
  • Run option disabled → Ensure main() method exists
  • Red error marks → Check spelling and semicolons ;
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments