Sitemap
Adarsh

Adarsh

Experienced software engineer with expertise in Java, C, C++, Python, Oracle SQL, Unix, and development tools like Eclipse, VS Code, and Putty.

Introduction to Java programming with Eclipse IDE

3 min readMay 21, 2023

--

In this blog, I will show you how to create a simple Java code/program that will print “Hello World” using Eclipse IDE.

Press enter or click to view image in full size

Per-requirements:

Download the latest Java version for your system — https://jdk.java.net/archive/

Configure the Windows environment variable once the Java is downloaded. If you are unaware of the process, check out the blog — Java environment variable configuration.

Download the Eclipse IDE zip file for your system and extract it — https://archive.eclipse.org/technology/epp/downloads/release/2021-06/R/

Introduction to Java programming:

Let us start creating a simple Java program to print “Hello World” in the console.

  1. Double-click on Eclipse and open it.
Press enter or click to view image in full size

2. Provide your system path for the Eclipse workspace and click on ‘Launch’, all the programs which you are going to write will be stored here.

Press enter or click to view image in full size

3. Once the Eclipse is opened, go to File → New → Java Project. It will open a window as below, give your project name and click on ‘Finish’.

Press enter or click to view image in full size

Once the Java project is created, you will be able to see your project at the left top side of Eclipse as below.

4. Create the Package and Class.

Package: it is nothing but a collection of Classes.

Class: It’s nothing but a template/blueprint that contains variables, methods, and constrictors.

Get Adarsh’s stories in your inbox

Join Medium for free to get updates from this writer.

Right-click on src → new → class

Give your Package name and Class name:

Press enter or click to view image in full size

Here I gave the Package name “com.java.medium”, this will create 3 sub-directories inside src as com/java/medium.

And for the Class name, I gave it HelloWorld, this will create a file inside the medium directory with the filename HelloWorld.java

Once you click on the finish, it will create the below program.

package com.java.medium;

public class HelloWorld {

public static void main(String[] args) {
// TODO Auto-generated method stub

}

}
  • In this, the first line indicates the package and the second line is for class.
  • And next is the Main method of this program.

5. Update the program with the print statement.

In Java, we will use the below statement to print lines.

System.out.println();

So the updated script will be below.

package com.java.medium;

public class HelloWorld {

public static void main(String[] args) {
// TODO Auto-generated method stub

System.out.println("Hello World");

}

}

Save the program and right-click → run as → Java application

Press enter or click to view image in full size

It will give the output in the console as below.

Press enter or click to view image in full size

This concludes the blog for Introduction to Java Code with Eclipse IDE. Please follow my blogs for more program-related blogs.

If you have any doubts, please let me know in the comment session below. Thank you.

--

--

Adarsh
Adarsh

Experienced software engineer with expertise in Java, C, C++, Python, Oracle SQL, Unix, and development tools like Eclipse, VS Code, and Putty.