Java: Hello World Program Example

Many coders first foray into software development began with two words, “Hello World”. In this tutorial we will demonstrate how to create a starter “Hello World” project in Java. Lets begin!

1. Install Eclipse IDE

Download eclipse from and save it to your hard drive. Unzip the file. After unzipping the file, open it and run the eclipse.exe file. An Eclipse Workspace dialog may appear, click the Ok button.

2. Create New Project

To create a new Eclipse project click File->New->Project


Eclipes File Menu, Create a new project by clicking File->New->Project

The New Project wizard will appear, select Java Project from the wizard options list and click the Next button.


Eclipse New Project dialog, allows you to choose the type of project you will create.

Enter a project name, for example “hello-world” and click the Finish button.


New Project Dialog accepts general information about the project that you will create. Such as project name.

The Open Associate Perspective? prompt may appear, Click the Yes button.


Step 3. Create a Class

Lets create a Java Class file by first expanding the project in the Package Explorer window on the left side of the screen. Then right click on the src folder of the project and click New->Class


The New Java Class dialog will appear. Enter package name -> com.letsbegin , for name enter -> Hello World. Select the checkbox public static void main(String[] args) and then click the Finish button.


 Step 4. Write Code

A new Java file will automatically open in the eclipse editor.


In the method main enter “System.out.println(“Hello World!!!”);”  as seen below:

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

6. Run Program

Right click on the project in the Package Explorer and click the Run button.


You will see the message “Hello World!!!” in the as seen below.



Congrats! you have written a classic Hello World Java Program!

Leave a reply