Beginning java programming using Eclipse
In this tutorial I will show you how to use the Eclipse IDE for the first time.
Start eclipse.exe from start menu.
Because this is your first time running Eclipse, it will take a while to load as it sets up the environment.
Once Eclipse is fully loaded you will see the Welcome Screen. You can close this straight away..
OK now lets start our first application.
Click File > New > Java Project
The 'Create a Java Project' box will popup.
Give your Project a name. In this case I have named it 'JavaPractice
Click FINISH.
You have now setup your first project which will appear in the Project Explorer window.
Before we can begin to write any code, we must first add a Package which will contain all our project files.
Select you project, right click and menu will appear. Select New option from menu and another menu will appear. Select package and new package dialog box will open.
Give your package a name relevant to your project.
Click FINISH
Now your Package has been created we need to add a Class file. Select you pacakage, right click and menu will appear. Select New option from menu and another menu will appear
The Create a New Java Class box will popup.
Give your Class a name and tick the public static void main(String[] args)box. Note that package name is shown in Package text box.
Your Class will now appear in the Workspace and you are ready to start writing code! Note the name of file and class are same.
Here we will write simple statement which will print the words into the console.
To Run your Java project. Right click the 'FirstExample.java' file in the Package Explorer window, then click Run As >Java Application
The output will now be displayed in the console.
In this way your first java program is complete using Eclipse IDE.
No comments:
Post a Comment