View
215
Download
0
Category
Preview:
Citation preview
Presented by IBM developerWorks
ibm.com/developerworks/
2006 January – April
© 2006 IBM Corporation.Making the most of Making the most of
Installing and running EclipseInstalling and running Eclipse
2-2 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
What we'll coverWhat we'll cover
Installing Eclipse
Running Eclipse
Eclipse terms and concepts: Perspectives, views, editors and other useful things
Other editing functions
Presented by IBM developerWorks
ibm.com/developerworks/
2006 January – April
© 2006 IBM Corporation.Making the most of Making the most of
Installing EclipseInstalling Eclipse
2-4 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Installing EclipseInstalling Eclipse
To get started, go to eclipse.org and click the downloads link.
2-5 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Installing EclipseInstalling Eclipse
Download the Eclipse SDK. Currently the file name is eclipse-SDK-3.1.2-win32.zip (for Windows)
This file contains everything from Eclipse, including the Eclipse platform and the SDK.
Download the file (use a mirror if you can) and unzip it.
You're done!You're done! There are instructions on the Eclipse download page if you need them.
2-6 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Other things at EclipseOther things at Eclipse
The Eclipse SDK download gives you everything you'll need to get started. There are other basic packages you might want to look at, though:Plug-in development environment (PDE)
Rich Client Platform runtime and SDK
FTP and WebDAV support
2-7 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
The Java Runtime EnvironmentThe Java Runtime Environment
Because Eclipse is written in Java, you have to have a Java Runtime Environment (JRE) on your machine. A JRE isn't included with Eclipse itself.
eclipse.org lists sites with JREs available if you need one. The Eclipse Foundation wisely doesn't recommend any particular
JRE.
JRE 1.5.0_02 works well, although you can have multiple JREs/JDKs installed on your machine and switch between them in Eclipse.
Presented by IBM developerWorks
ibm.com/developerworks/
2006 January – April
© 2006 IBM Corporation.Making the most of Making the most of
Running EclipseRunning Eclipse
2-9 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Running EclipseRunning Eclipse
Now that you've installed Eclipse, use the eclipse command to run it:
2-10 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
WorkspaceWorkspace
The workspace is a physical location on your machine. It contains projects, folders, and files.
A project is a collection of folders and files for a particular task.
A folder is a subdirectory; it can contain folders and other files.
A file is just a file.
In other words, a workspace is just a directory.
2-11 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Choosing a workspaceChoosing a workspace
The first time you run Eclipse, you'll be asked to choose a workspace.
You can also create different workspaces if you want. Each workspace is a different directory that contains a set of projects.
To open Eclipse in a particular workspace, type eclipse –data c:\workspace.
2-12 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Using different workspacesUsing different workspaces
You can create different shortcuts for different workspaces if you want:
2-13 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Switching workspacesSwitching workspaces
You can use the Switch Workspace… item on the File menu to change workspaces.
You can change to another workspace without restarting Eclipse.
2-14 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Performance tipPerformance tip
If Eclipse runs slowly, try adding this switch to the command line or shortcut: eclipse –vmargs –Xms256M
This starts the Java virtual machine with 256MB of RAM.
Eclipse loads plug-ins only when you need them, but it can start to slow down if you use lots of tools.This tip is particularly helpful on Windows platforms.
Presented by IBM developerWorks
ibm.com/developerworks/
2006 January – April
© 2006 IBM Corporation.Making the most of Making the most of
Eclipse terms and conceptsEclipse terms and concepts
2-16 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
WorkbenchWorkbench
The workbench is the Eclipse environment. When you open Eclipse, you see a workbench that displays the
resources in a particular workspace.
A workbench contains perspectives, views, and editors.
2-17 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
The workbenchThe workbench
2-18 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
PerspectivesPerspectives
A perspective is a set of views organized for a particular task. If you're writing Java code, certain views are useful.
If you're debugging Java code, other views are useful.
If you're modeling business processes, etcetera, etcetera…
A perspective lets you arrange the views you need.
Eclipse comes with several perspectives installed.
2-19 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
PerspectivesPerspectives
As you install plug-ins for various tasks, other perspectives may appear. The dialog on the left lists the perspectives shipped with the basic
Eclipse SDK.
The dialog on the right is from IBM's WebSphere Business Integration Modeler, an Eclipse-based product with many advanced features.
2-20 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Customizing perspectivesCustomizing perspectives
You can customize a perspective in many ways: You can change the views that
are part of a perspective
You can change how those views are arranged on the screen
If you use the Customize Perspective… menu item, you can define which menu items and toolbar buttons are available for a given perspective.
2-21 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Customizing perspectivesCustomizing perspectives
2-22 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Saving perspectivesSaving perspectives
When you have the views and toolbars and everything else arranged the way you want, you can save that as your own perspective.
You can overwrite existing perspectives if you want.
2-23 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
ViewsViews
A view is a window on some resources in your workspace. One view might list all the files in your workspace
Another view might list all the Java classes in a JAR file.
You can open and close and arrange views any way you like.
Two views might display the same thing in different ways.
2-24 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Two views of the same fileTwo views of the same file
2-25 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Opening viewsOpening views
The Window Show View menu lets you open a view at any time.
Click the Other… item to see a complete list of views.
2-26 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Moving and stacking viewsMoving and stacking views
To move a view, click and drag its tab. If more than one view is in the same space, they'll be stacked.
The Problems, Javadoc, Declaration and Console views are stacked here.
2-27 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Fast viewsFast views
A fast view has an icon; you can click on that icon to go directly to the view.
To create one, choose Fast View from the view's menu.
2-28 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
PreferencesPreferences
Eclipse has a number of preferences you can set.
Whenever you install a plug-in, that plug-in can have preferences also.As a result, your Eclipse installation can have literally hundreds of
settings.
Choose WindowPreferences to get to the Preferences dialog.
You can change just about everything.
2-29 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
PreferencesPreferences
2-30 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
PreferencesPreferences
If you have more than one Java Runtime Environment installed on your machine, you can tell Eclipse which one to use.
You can add new environments or change the default any time you want.
2-31 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
EditorsEditors
An editor allows you to modify a resource. There are different kinds of editors for different kinds of resources, as you'd expect.
Many plug-ins add their own editors, specialized for editing a particular type of document.
Like all views, editors can be stacked. The asterisk next to the file name above means that HelloWorld.java has been changed.
2-32 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
The Java editorThe Java editor
2-33 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
External editorsExternal editors
You can associate file types with external editors if you want. The underlying operating
system may have editors assigned to different file types already.
To associate file types with editors, go to Window PreferencesEditorsFile Associations. In this example, we're
associating the .ecore file type with the Ecore Model Editor.
Presented by IBM developerWorks
ibm.com/developerworks/
2006 January – April
© 2006 IBM Corporation.Making the most of Making the most of
Other editing functionsOther editing functions
2-35 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Other editing functionsOther editing functions
In addition to the editors themselves, Eclipse has several useful features for working with files.Searching
Bookmarking
Tasks
Local history
File comparison (think "visual diff")
Import/export
2-36 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
SearchingSearching
Eclipse has a very sophisticated search facility.
You can search through:Files
The help system
Java source
Plug-ins
There are special search options for each kind of search.
2-38 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
SearchingSearching
The results of the search show up in the Search view. You can double-click on a match and go directly to that file.
There are toolbar buttons in the Search view; these let you move through the search results. There will be different buttons depending on the kind of search.
2-39 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
BookmarkingBookmarking
You can create a bookmark in a file and go directly to that spot whenever you want.
To create a bookmark, right-click in the gray area on the left-hand side of the editor. You'll be asked to give the bookmark a name; that's what
2-40 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
BookmarkingBookmarking
All your bookmarks are listed in the Bookmarks view.
Notice that the bookmarks here are in different projects, and that not all of them are in Java files.
You can set a bookmark wherever you want.
2-41 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
TasksTasks
You can create tasks throughout your project. It's a way of building a to-do list.
You can associate a task with a line in a file ("add better error checking here") or create a more general task ("set up an Ant script to automatically regenerate the Javadoc")
2-42 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
TasksTasks
The first task here is a generic task that applies to the workspace.
The second is a specific task that applies to a particular line in a particular file.
As with bookmarks, you can create a task for any line in any file.
2-43 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Local historyLocal history
Only applicable to files
Each Save creates a new version
You can compare versions
There is a similar local history function for Java elements…
2-44 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Comparing FilesComparing Files
Highlight any two files and select Compare With Each Other from the context menu
Differences are shown visually
Move information from one file to another: Entire file
Current change
Select next or previous change
2-45 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Import/ExportImport/Export
Eclipse supports many different ways to import and export resources.You can import an existing project from another workspace
You can import or export a zip file, a JAR archive, an EAR file, etc.
You can also drag and drop files from the operating system into the Eclipse environment.Dragging and dropping files from Eclipse into operating system
containers (Windows Explorer, for example) also works.
2-46 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Navigating resourcesNavigating resources
The Navigate menu has many ways to find and view your resources.
Go Into Also available from context
menu
Go backwards and forwards using the arrow icons
At lower levels the view includes the name of a folder or file
GoTo Start typing the name of the
resource to limit the choice
All other resources are hidden
2-47 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Copying, moving, renamingCopying, moving, renaming
Copying and moving resources:Use the command from the context menu, or
Drag and drop the resource Copy by holding the Ctrl key as you drag
The Ctrl+X, Ctrl+C and Ctrl+V combinations work most of the time as well (depends on the view)
Renaming is part of Eclipse's refactoring support.
2-48 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
PropertiesProperties
All resources have properties The Properties view gives basic
information on the resource
The Properties dialog (right-click the resource and select Properties) gives much more detailed info
Some resources have more properties than others.
2-49 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Team functionsTeam functions
Eclipse has built-in support for versioning, configuration management and interacting with code repositories such as CVS.
Eclipse also supports FTP and WebDAV.
As with everything in the world of Eclipse, many groups (including IBM) have taken these basic functions and extended them.
2-50 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
Help is on the wayHelp is on the way
Eclipse's help system is very sophisticated. Choose HelpHelp Contents to see it.
You can view help topics from a list, or you can search for what you need.
When you install a plug-in, its help information is integrated with everything else in the platform. You can create a plug-in that does nothing more than add
information to the help system.
Presented by IBM developerWorks
ibm.com/developerworks/
2006 January – April
© 2006 IBM Corporation.Making the most of Making the most of
SummarySummary
2-53 Making the most of © 2006 IBM Corporation.
Presented by IBM developerWorks
SummarySummary
We've looked at the basics of installing and running Eclipse.We also discussed the basic terminology of Eclipse, such as
perspectives, views, editors and so forth.
Eclipse is extremely customizable, so you can make the tool work however you think best.
Eclipse also gives you very powerful editing tools to help you manage your code and documents.
Recommended