- Get link
- X
- Other Apps
Creating Java Project in Eclipse
In the previous post, we learnt about downloading & installing Eclipse IDE . In this post, you will learn to create first project, creating a new Java Class ,compiling and executing project in eclipse console.
Lets begin!
Steps:-
- Open Eclipse IDE by searching for eclipse in Start search bar. When you its Icon , Click on Eclipse Icon it will get open. If you don't find Eclipse icon when you search then just go down on this post I had the same problem and I have mentioned the solution in the last paragraph of this post.
- When you open Eclipse for the first time, It does not have any project. So, to Create first Java Project Click on Icon marked with red in image below.
- Now, you will see the screen as below.
- To create Java project , Click on "Create a Java Project " OR Go to File menu>New>Java Project. Now a Wizard will open as follows. Write a name for your project as shown then Click Finish.
- Now the Eclipse Window will open as shown below.
- Go to src folder > Right Click >New >Java Class. Another wizard will open to ask about details of Java class.
- Write name of class and tick the checkbox as follows, Then Click Finish, If you want your class to have main method, then tick the following checkbox. To run program you must have main method in class.
- Now your Java class is created and write simple to print sum of two numbers. As int is datatype use for Integer values, we will use it to store value of numbers and print statement to print the sum. To understand the program read the comments in green in image.
- You have wrote the program, Now, its time to execute it. Go to Run Menu> Click on Run as> Java Application1 Or Click on Green play button as shown. \
- If you used first method to run the program. Then a dialog box will appear as follows:- Click Ok.
Congratulations! Our program has executed successfully. Now, trying making,subtraction,multiplication, division programs an execute them. Happy Coding!
Eclipse
Here, I want to share a issue of Eclipse with you guys that I faced and it took me a lot of days to solve it.Whenever I tried Opening it I had to Run its setup file again and again.So, to solve this issue I finally pinned its .exe file on taskbar and click on it. Then a dialog box appears that ask me Run it again, there was checkbox in the dialog box , I checked it. After this, Eclipse is running smoothly.I tried finding solution many times but nothing worked but this method actually solved it. If you have the same issuse try this.
Comments
Post a Comment
If you have any doubt, ask here