Core Java Tutorial 06 – Running First Java Program using Eclipse IDE – HelloWorld

In this video  tutorial, we will learn how to use Eclipse IDE for creating our first Java program i.e HelloWorld.

For our readers who are unable to access the Video Tutorial!!!

For writing our first Java Program using Eclipse IDE :

1) Go to the folder where you unzipped Eclipse contents and  double click on the eclipse shortcut to open the eclipse IDE

2) When we open the Eclipse IDE, it will ask for a location where we want to save the programs written using Eclipse IDE – either choose the default location provided by eclipse or provide your own and then click on Ok.

3)  In Eclipse for writing any Java Program or Application you are required to create a Java Project with the NAME and then one can just  go on creating and running any number of Java Program files in it.

4) Right click  anywhere on the space below Package Explorer- choose— NEW —PROJECT— JAVA PROJECT—NEXT——NAME THE PROJ ECT and then —FINISH.

( Hint: provide any name to the project; I have given it a name HelloWorld in the video tutorial)

6) And now for creating  the same HelloWorld program in Eclipse which we created using notepad in Core Java Tutorial Series Part 04 —RIGHT CLICK ON SRC—-Choose OTHER— and inside Java choose CLASS—provide the Java file name (here we have used the file name as HELLO WORLD and click on —FINISH.

copy the below program in the class file  you created just now:

public class HelloWorld {
 public static void main(String[] args) {
 System.out.println("Hello, World"; This is my First Java Program using Eclipse IDE...);
 }
 }

7) As discussed in our Core Java Tutorial 04, we ran Java Program in  two steps

a) We compiled the Program using javac command and then

b) Ran it using java command on the command prompt window. BUT ;

when we use Eclipse, we are free from all these tedious steps like opening the command prompt then compiling and then running.

(In Eclipse, you just need to right click on the file containing the java program and choose run as java application;  it will compile and run the program and produces the output in Eclipse only.)

8 ) Here is the output, generated by our simple HelloWorld program written using Eclipse IDE.

Happy Learning!!!