Scanner class Methods in Java

Creating First Java Project in Eclipse

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.

Creating First Java Project in Eclipse IDE
  • Now, you will see the screen as below.
Creating First Java Project in Eclipse IDE
  • 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.
Creating First Java Project in Eclipse IDE
  • Now the Eclipse Window will open as shown below.

Creating First Java Project in Eclipse IDE
  • Go to src folder > Right Click >New >Java Class. Another wizard will open to ask about details of Java class. 


Creating First Java Project in Eclipse IDE

  • 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.
 

Creating First Java Project in Eclipse IDE

  •  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.
 

Creating First Java Project in Eclipse IDE

  • 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. Creating First Java Project in Eclipse IDE\
  • If you used first method to run the program. Then a dialog box  will appear as follows:- Click Ok.

Creating First Java Project in Eclipse IDE  

  • Now you can see the Output as highlighted below:- Console will give you results of programs.Creating First Java Project in Eclipse IDE

 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