Difference between revisions of "Java/C2/Getting-started-Eclipse/English"
(Created page with ''''Author''' : Bhairav Prasad Katipalli '''Script Title''' : Getting Started with Eclipse IDE '''Keywords''' : Eclipse, IDE. {| style="border-spacing:0;" | style="border:0.0…') |
|||
| Line 33: | Line 33: | ||
| − | * Create project | + | * How to Create project add a class in Eclipse |
| − | * How to write java source code and | + | * How to write a java source code and |
* How to run program in Eclipse | * How to run program in Eclipse | ||
| Line 60: | Line 60: | ||
| − | | style="border:0.035cm solid #000000;padding:0.097cm;"| To follow this tutorial you | + | | style="border:0.035cm solid #000000;padding:0.097cm;"| To follow this tutorial you must have |
* Eclipse installed on your system. | * Eclipse installed on your system. | ||
| Line 90: | Line 90: | ||
| − | | style="border:0.035cm solid #000000;padding:0.097cm;"| We | + | | style="border:0.035cm solid #000000;padding:0.097cm;"| We have a '''Workspace Launcher''' dialog box. |
| − | A workspace is a location where all | + | A workspace is a location where all the project realated data and the eclipse related files are stored. |
| Line 110: | Line 110: | ||
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| Hover the mouse over the '''Welcome Page.''' | | style="border:0.035cm solid #000000;padding:0.176cm;"| Hover the mouse over the '''Welcome Page.''' | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| We have the '''Welcome to Eclipse''' page. | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| and We have the '''Welcome to Eclipse''' page. |
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| Click on''' Workbench''' | | style="border:0.035cm solid #000000;padding:0.176cm;"| Click on''' Workbench''' | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| Click '''Workbench''' | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| Click '''Workbench''' which is at the top-right corner of the page. |
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| | | style="border:0.035cm solid #000000;padding:0.176cm;"| | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| | + | | style="border:0.035cm solid #000000;padding:0.176cm;"|And here we have Eclipse IDE. Now let us add a project. |
|- | |- | ||
| Line 172: | Line 172: | ||
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| | | style="border:0.035cm solid #000000;padding:0.176cm;"| | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| Here we | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| Here we haveeclipse IDE in the project. Now let us add a class to the project. |
|- | |- | ||
| Line 178: | Line 178: | ||
'''New -> Class''' | '''New -> Class''' | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| Right click on the project, '''new ''' | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| Right click on the project, '''new ''' select '''class''' |
|- | |- | ||
| Line 192: | Line 192: | ||
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| | | style="border:0.035cm solid #000000;padding:0.176cm;"| | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| For now, | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| For now, leave it as public. |
|- | |- | ||
| Line 200: | Line 200: | ||
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| Select '''public static void main''' | | style="border:0.035cm solid #000000;padding:0.176cm;"| Select '''public static void main''' | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| And in the list of stubs select the option that says'''public static void main''' |
|- | |- | ||
| Line 228: | Line 228: | ||
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| click on Outline portlet | | style="border:0.035cm solid #000000;padding:0.176cm;"| click on Outline portlet | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| And the Outline portlet | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| And the Outline portlet it gives a hierarchy of the project. |
|- | |- | ||
| Line 236: | Line 236: | ||
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| minimize the portlets | | style="border:0.035cm solid #000000;padding:0.176cm;"| minimize the portlets | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| They can be minimized by | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| They can also be minimized by using the minimize button |
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| restore the portlets | | style="border:0.035cm solid #000000;padding:0.176cm;"| restore the portlets | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| They can | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| They can be restored by using the restore button. |
|- | |- | ||
| Line 256: | Line 256: | ||
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| | | style="border:0.035cm solid #000000;padding:0.176cm;"| | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| Now let us add | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| Now let us add a print statement here. |
|- | |- | ||
| Line 268: | Line 268: | ||
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.097cm;"| | | style="border:0.035cm solid #000000;padding:0.097cm;"| | ||
| − | | style="border:0.035cm solid #000000;padding:0.097cm;"| Save the file by clicking | + | | style="border:0.035cm solid #000000;padding:0.097cm;"| Save the file by clicking '''File '''and select '''Save''' |
| − | + | ||
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| | | style="border:0.035cm solid #000000;padding:0.176cm;"| | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| Alternatively, you can use the shortcut '''Control S''' | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| Alternatively, you can use the shortcut '''Control S''' also |
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| | | style="border:0.035cm solid #000000;padding:0.176cm;"| | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| To run this program, right click on the '''editor''', go to '''run as''' and select '''java | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| To run this program, right click on the '''editor''', go to '''run as''' and select '''java applicationapplication''' |
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| | | style="border:0.035cm solid #000000;padding:0.176cm;"| | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| We see that if somethng is printed, the '''Output''' | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| We see that if somethng is printed, the '''Output''' console shows the output. |
|- | |- | ||
| style="border:0.035cm solid #000000;padding:0.176cm;"| | | style="border:0.035cm solid #000000;padding:0.176cm;"| | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| If our code had problems, | + | | style="border:0.035cm solid #000000;padding:0.176cm;"| If our code had problems, the problem would have been shown on the '''Problems''' portlet |
|- | |- | ||
| Line 300: | Line 300: | ||
| − | | style="border:0.035cm solid #000000;padding:0.176cm;"| In this tutorial, we have learnt how to create project in eclipse and a class to it. How to Write a java source code and how to run a java program in Eclipse. | + | | style="border:0.035cm solid #000000;padding:0.176cm;"|This brings us to the end of this tutorials. In this tutorial, we have learnt how to create a project in eclipse and a class to it. How to Write a java source code and how to run a java program in Eclipse. |
|- | |- | ||
| Line 315: | Line 315: | ||
| − | | style="border:0.035cm solid #000000;padding:0.097cm;"| * create a | + | | style="border:0.035cm solid #000000;padding:0.097cm;"| AS an assignment for this tutorial * create a project, by the name '''Display''' |
| − | * | + | * and add a class to the '''Display''' project, by the name '''Welcome ''' |
Latest revision as of 13:19, 7 May 2013
Author : Bhairav Prasad Katipalli
Script Title : Getting Started with Eclipse IDE
Keywords : Eclipse, IDE.
| Visual cue | Narration |
| Slide 1
Welcome Slide |
Welcome to the spoken tutorial on Getting started with Eclipse. |
| Slide 2
Learning Objectives
|
In this tutorial we are going to learn
|
| Slide 3
Software Versions |
For this tutorial we are using:
|
| Slide 4
Pre-requisites
|
To follow this tutorial you must have
|
| Slide 5
Introduction to Eclipse |
Eclipse is an Integrated Development Environment
|
| Press Alt + F2
Type eclipse |
Now let us open Eclipse.
|
| Hover the mouse over Eclipse Workspace Launcher
|
We have a Workspace Launcher dialog box.
|
| Click on OK. | Click OK to proceed. |
| Hover the mouse over the Welcome Page. | and We have the Welcome to Eclipse page. |
| Click on Workbench | Click Workbench which is at the top-right corner of the page. |
| And here we have Eclipse IDE. Now let us add a project. | |
| File -> New -> Project | go to File
|
| In the list of projects, select Java Project | |
| Click Next | Also note that, for most of our tutorials, we will be using java project. Click Next |
| Type EclipseDemo in the name field | In the project name, type EclipseDemo |
| Notice an option that says use default location | |
| if this option is selected, all the EclipseDemo project data is stored in the default workspace. | |
| If it is unselected, using the browse feature, a different location can also be selected.
For now we’ll use the default location. | |
| Click Finish | click Finish located at the bottom right corner of the Wizard. |
| Select the checkbox and click Yes | We get the Open Associated Perspective dialog box.
|
| Here we haveeclipse IDE in the project. Now let us add a class to the project. | |
| Right click on the project,
New -> Class |
Right click on the project, new select class |
| Type DemoClass in name field | In the class name, give DemoClass |
| Notice that in modifiers, we have two options,
public and default | |
| For now, leave it as public. | |
| The other options will be discussed in subsequent tutorials. | |
| Select public static void main | And in the list of stubs select the option that sayspublic static void main |
| The other options will be discussed in subsequent tutorials. | |
| click Finish | click Finish located at the bottom right corner of the wizard. |
| Here we have the class file. | |
| Notice that there are a lot of partitions. These are called portlets. | |
| click on Package Explorer portlet | We have the Package Explorer portlet that behaves like a File Browser |
| click on Editor portlet | We have the Editor portlet in which we write the code. |
| click on Outline portlet | And the Outline portlet it gives a hierarchy of the project. |
| resize the portlets | Each portlet can also be resized |
| minimize the portlets | They can also be minimized by using the minimize button |
| restore the portlets | They can be restored by using the restore button. |
| minimize other portlets | Now let us minimize other portlets and focus on the Editor. |
| As we can see, there is already some code, Eclipse has generated for us. | |
| The code generated here depends on the options we select, while creating the class. | |
| Now let us add a print statement here. | |
| System.out.println(“Hello Eclipse”); | Type System.out.println(“Hello Eclipse”). |
| Add a semicolon at the end of the statement. | |
| Save the file by clicking File and select Save | |
| Alternatively, you can use the shortcut Control S also | |
| To run this program, right click on the editor, go to run as and select java applicationapplication | |
| We see that if somethng is printed, the Output console shows the output. | |
| If our code had problems, the problem would have been shown on the Problems portlet | |
| Here is how you write and run a Java program in Eclipse | |
| Exit the Eclipse window and show Slide window
Summary
|
This brings us to the end of this tutorials. In this tutorial, we have learnt how to create a project in eclipse and a class to it. How to Write a java source code and how to run a java program in Eclipse. |
| Slide 7
Assignment
|
AS an assignment for this tutorial * create a project, by the name Display
|
| Slide 8
About the Spoken Tutorial Project
|
For more information on the Spoken Tutorial Project, watch the video available at the following link
|
| Slide 9
Spoken Tutorial Workshops
|
The Spoken Tutorial Project Team
|
| Slide 10
Acknowledgement
|
* Spoken Tutorial Project is a part of the Talk to a Teacher project
|
| Slide 11
About the contributor
|
* This tutorial has been contributed by TalentSprint
|