Sumitra V (Eclipse IDE) - Uvce Web Techies

oralwideΔιακομιστές

17 Νοε 2013 (πριν από 3 χρόνια και 8 μήνες)

138 εμφανίσεις

Title
:


Eclipse SDE (
software development environment
)

/ IDE (Integrated DE)

Author
:


SUMITHRA V

Date
:


25
-
04
-
2013

About Tool
:



In

computer programming,

Eclipse

is a multi
-
language

software development
environment

comprising a base

workspace

and an extensible

plug
-
in

system for
customizing the environment. It is written mostly in

Java
.



It can be used to develop applicatio
ns in Java and, by means of various plug
-
ins,
other

programming language including C, C++, COBOL, Fortran, Haskell,
JavaScript, Perl, PHP, Python, Ruby, Scala, Clojure, Groovy, Scheme, and Erlang.



Development environments include the Eclipse Java
development tools (JDT) for
Java and Scala, Eclipse CDT for

C/C++

and Eclipse PDT for PHP, among others.


Terminologie
s:

Terms

Explanation

Workspace

A TFS workspace is a location on a Team Foundation Server (TFS)
where a record of changes between local fi
les and corresponding
repository files are stored. It can also be thought of as:



a
copy

of the client side directory.



a staging ground where local changes are persisted until
they are
checked in

to the server.



a collection of working folder mappings which can be
viewed and edited in the
Edit Workspaces

dialog.

project

projects comprise all the effort of a software development project,
including project management documents, work item tracking, and
the source control rep
ository. Directories you see in the
Source
control view

are directories in the source control repository node,
one of
four nodes

comprising a Team project. Team projects can
contain one or more Eclipse projects.

Working Folder

A Working Folder refers to the client side folder of a TFS
workspa
ce
mapping
. In Eclipse, the Working Folder is always the
current Eclipse workspace directory. When a file is checked out for
editing, teamprise mak
es the file "writeable" in the Eclipse
workspace. Modifications made to files in a working folder are
tracked in a
TFS workspace
. When a file

is checked in, the TFS
workspace ensures that the corresponding file in the server folder is
updated with the changes.

Console

When Console view is enabled it displays the output of Teamprise
commands. If an error occurs during a operation with TFS, the

Console provides details that can help troubleshoot the cause of the
error. Console opens by default when you perform an action. You
can also invoke it from the Explorer menu by selecting
View >
Console
.

Repository

A database tier of the Team Foundation
Server. The remote
location where source code files, work items, and reports are
stored.

Views

The following
Teamprise views

are implemented in Eclipse to
facilitate exchanges with the TFS:



Team Explorer



Pending Changes



History View



Console



Synchronize

The Team Explorer and Pending Changes view comprise the
TFS
Explorer perspective
.

Preferences


Once the application is installed you can use the
Preferences
dialog accessed from menu
Window
>
Preferences
to cust
omize
the application.You can always revert modifications to their default
values by pressing the
Restore Defaults
button, available in each
options page.



Licensing
:


Eclipse platform and other plug
-
ins from the Eclipse foundation is released under the
Eclipse
Public License (EPL).EPL ensures that Eclipse is free to download and install. It also allows
Eclipse to be modified and distributed.


Version History
:

Codename

Date

Platform version

Projects

N/A

21 June 2004

3.0

[1]


N/A

28 June 2005

3.1


Callisto

30 June 2006

3.2

Callisto projects

Europa

29 June 2007

3.3

Europa projects

Codename

Date

Platform version

Projects

Ganymede

25 June 2008

3.4

Ganymede projects

Galileo

24 June 2009

3.5

Galileo projects

Helios

23 June 2010

3.6

Helios projects

Indigo

22 June 2011

3.7

Indigo projects

Juno

27 June 2012

4.2(Current Version)

Juno projects

Kepler

26 June 2013 (planned)

4.3

Kepler projects

Luna

25 June 2014 (planned)

4.4

Luna projects


Requirements/ Prerequisites to have this tool
:

The latest version of Subversive is compatible with JDK 1.5, Eclipse 3.6 and later versions. It
supports SVN versions 1.1 through 1.7. Subversive SVN Connectors are available for
different pla
tforms. For Windows x86, you can install the JavaHL with corresponding
binaries or SVNKit connectors. For other platforms, you have to install the SVNKit
connector or if you're installing JavaHL, additionally install a package that contains JavaHL
binaries

for the platform.



How to get
started with if a tool/software:

Downloading Eclipse

You can download eclipse from
http://www.eclipse.org/downloads/
. The download pa
ge lists
a number of flavours of
eclipse.




The capabilities of each packaging of eclipse

are different. Java developers typically use

Eclipse Classic or Eclipse IDE
for developing Java applications.

The drop down box in the right corner of the download page allows you to set the opera
ting
system on which eclipse is
to be installed. You can ch
oose between Windows, Linux and
Mac. Eclipse is packaged as a zip file.


Installing Eclipse

To install windows you need a tool that can extract the contents of a zip file.

Extract the
contents of the eclipse zip file to any folder of your choice.





How

it works
:

1.

Launching Eclipse
:


On the windows platform, if you extracted the contents of the zip file to c:
\
, then you can start
eclipse by using c:
\
eclipse
\
eclipse.exe .When eclipse starts up for the first time it prompts you
for the location of the
workspace folder. All your data will be stored in the workspace folder.
You can accept the default or choose a new location.


OR


To open Eclipse tool, Double click on Eclipse icon.

Parts of an Eclipse Window/Perspective


The major visible parts of an
eclipse window are:



Views



Editors (all appear in one editor area)



Menu Bar



Toolbar

An eclipse perspective is the name given to an initial collection and arrangement of views
and an editor area. The default perspective is called java. An eclipse window can
have
multiple perspectives open in it but only one perspective can be active at any point of time. A
user can switch between open perspectives or open a new perspective. A perspective controls
what appears in some menus and tool bars. A perspective has onl
y one editor area in which
multiple editors can be open. The editor area is usually surrounded by multiple views. In
general, editors are used to edit the project data and views are used to view the project
metadata. For example the package explorer shows
the java files in the project and the java
editor is used to edit a java file.

The eclipse window can contain multiple editors and views but only one of them is active any
given point of time. The title bar of the active editor or view looks

different from

all the
others.
The UI elements on the menu bar and tool bar represent commands that can be
triggered by an end user.



2. Now select new project by following the
path. File

New

Java Project
.




3.

Type the new project name /select the existing project,
in the default work space or New
location.




4.

The newly created project will appear in left side of Eclipse window.




5. To

create new class
File

new

Class. Type class name and other properties in that
window.




6. Select source folder for the new
class.




7. The class will be displayed in the editor mode with same name as that of your class name.
The class name can be seen in left side under the respective source folder.



8. Now include your code inside the class, it supports for code completio
n to complete the
sentence press ctrl+spc and select the suitable one from the drop down list.



9. Errors

will be indicated in different
colour, place

cursor on it
you can see the
the
suggestion
to clear the error.




10.
After debugging errors.



11
.
Run

Run As

1.Java Application.





12.Finally you can see the output on console mode in the bottom,as shown below.


Using Multiple Windows

Multiple Eclipse Windows can be open at the same time. To open a new window, click on the
Windows menu and select
the New Window menu item.
Each window can have a different
perspective open in them. For example you could open two Eclipse windows one in the Java
perspective and the other in the Debug perspective. The window showing the Java
perspective can be used for
editing the java code and the window showing the debug
perspective can be used for debugging the application being developed.






How to create a web application in eclipse:


1.

Download and install
http://tomcat.apache.org/

2.


Download and install Eclipse IDE for Java EE Developers

3.


Start Eclipse

4.

Window
-
> Preferences
-
> Web
-
> CSS+HTML+JSP
-
> Encoding: ISO



10646/Unicode(UTF
-
8)

5.

Window
-
> Open Perspective
-
> Other
-
> Java EE

6.


File
-
> New
-
>

Dynamic Web Project

7.


Enter Project name

8.

Target Runtime
-
> [New…]
-
> Apache
-
> Apache Tomcat vX.X
-
> Next
-
> Tomcat

Installation

directory
-
> [Browse…]
-
> <Path to tomcat>
\
Tomcat X.X
-
> Finish

9.

Finish

10.

Right click on WebContent
-
> New
-
> JSP (index.html / in
dex.jsp as startfile)
-
> Next
-
>Use JSP template
-
> New JSP File(xhtml)
-
> Finish

11.


Right click on project
-
> Run As
-
> Run on Server
-
> Finish

12.


Project is available under
http://localhost:8080/projectname

13.


To change the context root/URI in eclipse : Right click on project
-
> Properties
-
>WebProject Settings
-
> "New Context root"
-
> Apply
-
> OK
-
> OK

14.

Right click project
-
> Export
-
> WAR file
-
> Destination:
-
> [Browse…]
-
> <Path to

tomcat>
\
Tomcat X.X
\
webapps
(write name in small letters)
-
> Save
-
> Finish

15.

To change the context root/URI for
tomcat just rename the WAR file

16.

Stop Eclipse
-
tomcat
-
server by pressing STRG+ALT+S

17.


Start tomcat ("<Path to tomcat>
\
Tomcat X.X
\
bin
\
tomcatXw.exe")

18.

Now Project is deployed in
tomcat and can be used without eclipse




H
ow to work with MySQL database

in eclipse:

In this part we'll create a database named 'test' and then work with this database using eclipse.
So, let's start. Before you can connect to MySQL Server through Eclipse, you need to
download
mysql
-
connector
-
java
-
5.1.18.jar

and include it into your project

libraries using
Build Path. Download the jar file from http://www.mysql.de/downloads/connector/j/ as in the
figure:

In this part we'll create a database named 'test' and then work with this database using eclipse.
So, let's start. Before you can connect
to MySQL Server through Eclipse, you need to
download
mysql
-
connector
-
java
-
5.1.18.jar

and include it into your project libraries using
Build Path. Download the jar file from http://www.mysql.de/downloads/connector/j/ as in the
figure:


In your project explorer Eclipse right
-
click on your project and click on Build Path
-
>
Configure Build Path. In the Libraries tab click on Add External JARs and then browse to
your directory where you have downloaded the jar file. Your window would look l
ike the
following; click Ok.




Now we'll create our test database. Open MySQL Command Line Client as shown in the
previous part and give the command
create database test
. This will create a database named
test

as in the figure below:






In the lower

panel of eclipse you could find Data Source Explorer as in the figure below:


Drag this tab and drop it in the left panel besides Project Explorer tab as shown in the
following figure so that you can have both views on left panel this will make things e
asy to
use in future.


If you don't see Data Source Explorer here, then in eclipse menubar, click on Window
-
>
Open Perspective
-
> other
-
> Database Development as in the figure below; this will open
Data Source Explorer in left panel. To switch back to
your Project Explorer, click on
Window
-
> Open Perspective
-
> other
-
> Java EE (default).

In the Data Source Explorer right
-
click on Database Connections and click New.








In
Connection Profile

window select MySQL and in the name field write
Test
MySQL
;
click Next.


On the upper right corner click on
New Driver Definition

button.


In
New Driver Definition

window, select
MySQL JDBC Driver MySQL 5.1

and then click
JAR List

tab.


In
JAR List

tab, select the default driver and click on
Edit JAR/Z
ip...

button.





Select the jar file which you have downloaded above, click Open and then click Ok.


In the
General

tab under
Properties
, change the database name in the
Database

and
URL

field to your database name as in the figure. In our case it is
test
. Give your password which
you have created in the previous part. Check
Save password
, and click on
Test Connection

and you will see ping successful message. Click Finish.


To create tables in database using eclipse, select your database
test
, then open the
scrapbook

by clicking on the button placed in the right corner of Data Source Explorer as in the figure:



In the scrapbook write the following query to create a table customer.



Right
-
click in the scrapbook and click Execute All.


You will see the see the success message in the
SQL Result

tab.



You can view your tables in In the
Data Source Explorer

like this.







Insert some rows in the table by right
-
clicking on your table and then clicking Data
-
> Edit