In the previous article, I have explained ‘Installing and Launching Eclipse IDE‘.
In this article, I will practically explain ‘Creating a Java Project in Eclipse IDE’
Before moving ahead, make sure the below are available in your machine:
- > Java (Refer Installing and Configuring Java)
- > Eclipse IDE (Refer Installing and Launching Eclipse IDE)
Let’s get started
Java for Testers – Creating a Java Project in Eclipse IDE
Follow the below steps for creating a Java Project in Eclipse IDE:
1) Open Eclipse IDE and select File > New > Project as shown below:
2) In the displayed ‘New Project’ dialog, expand ‘Java’, select ‘Java Project’ and click on ‘Next’ button as shown below:
3) In the displayed ‘New Java Project’ dialog, enter any name say ‘FirstProject’ and click on ‘Finish’ button as shown below:
4) Observe that a Project with name ‘FirstProject’ got created and displayed as shown below:
5) Expand the above Project, right-click on ‘src’ and select ‘New’ > ‘Class’ as shown below:
6) In the displayed ‘New Class’ dialog, give any name say ‘Demo’, select ‘public static void main(String args)’ checkbox option and click on ‘Finish’ button as shown below:
7) Observe a class file having ‘Demo’ name got created with some default code as shown below:
Note: Don’t worry if you are new to Java and don’t understand any of the auto-generated Java code here. I will explain each and every element in the code when required.
8) Let’s write a sample Java statement which prints the given text as shown below:
Note: I will explain print statements in detail in the upcoming article. Till then blindly follow my explanation with the intention of executing the code at the Project level.
9) Save the Project and click on ‘Run’ button as shown below:
10) Observe that the Program got executed and ‘Hello World!’ text inside the print statement got printed as output in the Console tab as shown below:
Here concludes the practical demonstration of creating and executing a Java project in Eclipse IDE.
In the next article, I will start explaining each and every element of the above Java code in the Project.
- > To learn more about Java, continue to the next post (Click on Next Post link below)
- > Check complete Java Tutorial Contents here (Click here)
Please leave your questions/comments/feedback below:
Happy Learning 🙂
Arun Motoori (www.QAFox.com)
On a mission to help the Testing Community in all possible ways.