Java/C2/Getting-started-Eclipse/English

From Script | Spoken-Tutorial
Revision as of 15:38, 27 November 2012 by Chandrika (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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


By the end of this tutorial you should be able to:

  • Create project and class
  • Write a java source code using Eclipse
  • Compile the source code and
  • Execute a java program


In this tutorial we are going to learn


  • Create project in eclipse and class
  • How to write java source code and
  • How to run program in Eclipse


Slide 3

Software Versions

For this tutorial we are using:
  • Ubuntu 11.10,
  • Eclipse 3.7


Slide 4

Pre-requisites


  • Eclipse and JDK are installed in your System
  • If not, please go through the tutorials on these topics available at our website[1]http://spoken-tuitorial.org


To follow this tutorial you need to have
  • Eclipse installed on your system.
  • If not, for relevant tutorial please visit our website as shown.


Slide 5

Introduction to Eclipse

Eclipse is an Integrated Development Environment


It is a tool on which one can write, debug and run java programs easily.

Press Alt + F2

Type eclipse

Now let us open Eclipse.


Press Alt F2 and in the dialog box, type eclipse and hit enter.

Hover the mouse over Eclipse Workspace Launcher


We get a Workspace Launcher dialog box.


A workspace is a location where all your project realated data and your eclipse related files are stored.


There is already a location which is the default location.


Using the browse feature, a different directory can also be selected.


For now let us proceed with the default directory.

Click on OK. Click OK to proceed.
Hover the mouse over the Welcome Page. We have the Welcome to Eclipse page.
Click on Workbench Click Workbench located at the top-right corner of the page.
We have Eclipse IDE. Now let us add a project.
File -> New -> Project go to File


New and select Project

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.


A perspective refers to the way items are arranged in Eclipse.


The dialog box is suggesting a perspective that is suited for Java development.


Select remember my decision and click Yes.

Here we have the project. Now let us add a class to the project.
Right click on the project,

New -> Class

Right click on the project, new and 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, let us leave it as public.
The other options will be discussed in subsequent tutorials.
Select public static void main Notice the options for method stubs. For now, we’ll be using public 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 that gives a hierarchy of the project.
resize the portlets Each portlet can also be resized
minimize the portlets They can be minimized by clicking the minimize button
restore the portlets They can also be restored by clicking 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 the 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 on File and select Save
Alternatively, you can use the shortcut Control S
To run this program, right click on the editor, go to run as and select java application
We see that if somethng is printed, the Output portlet shows the output.
If our code had problems, they 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


Slide 6

Summary


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

Assignment


  • create a new project, name it as Display
  • create a new class file, name it as Welcome and
  • print output statement as Welcome to Eclipse
  • create another class file, name it as ThankYou and
  • print output statement as Thank You for visiting Eclipse


* create a new project, by the name Display
  • create a new class file under Display project, by the name Welcome


Slide 8

About the Spoken Tutorial Project


  • It summarises the Spoken Tutorial project
  • If you do not have good bandwidth, you can download and watch it


For more information on the Spoken Tutorial Project, watch the video available at the following link
  • It summarises the Spoken Tutorial project
  • If you do not have good bandwidth, you can download and watch it


Slide 9

Spoken Tutorial Workshops


The Spoken Tutorial Project Team

  • Conducts workshops using spoken tutorials
  • Gives certificates for those who pass an online test
  • For more details, please write to contact@spoken-tutorial.org


The Spoken Tutorial Project Team


  • Conducts workshops using spoken tutorials
  • Gives certificates for those who pass an online test
  • For more details, please write to contact at spoken hyphen tutorial dot org


Slide 10

Acknowledgement


  • Spoken Tutorial Project is a part of the Talk to a Teacher project
  • It is supported by the National Mission on Education through ICT, MHRD, Government of India
  • More information on this Mission is available at


* Spoken Tutorial Project is a part of the Talk to a Teacher project
  • It is supported by the National Mission on Education through ICT, MHRD, Government of India
  • More information on this Mission is available at
  • spoken hyphen tutorial dot org slash NMEICT hyphen Intro


Slide 11

About the contributor


  • This tutorial has been contributed by TalentSprint
  • Thanks for joining


* This tutorial has been contributed by TalentSprint
  • Thanks for joining.


Contributors and Content Editors

Chandrika, Sneha