DOC PREVIEW
UMBC CMSC 341 - Introduction to Eclipse

This preview shows page 1-2-3-4-25-26-27-51-52-53-54 out of 54 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 54 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 54 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 54 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 54 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 54 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 54 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 54 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 54 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 54 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 54 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 54 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 54 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Introduction to EclipseOverviewWhat is Eclipse?Prerequisites for Running EclipseEclipse on GLObtaining EclipseInstalling EclipseLaunching EclipseSelecting a WorkspaceWelcome to EclipseEclipse IDE ComponentsCreating a New ProjectCreating a New Project (continued)Slide 14The src folderCreating a ClassCreating a Class (continued)The Created ClassCompiling Source CodeExample Compilation ErrorExample Compilation Error (continued)Running CodeRunning Code (continued)Run ConfigurationRun Configuration (continued)Re-Running CodeDebugging CodeDebugging Code (continued)Debugging Code (Continued)Debug PerspectiveSampling of Some Other FeaturesImport OrganizationImport Organization (continued)Slide 34Context AssistJavadoc AssistJavadoc Assist (continued)Getter/Setter GenerationGetter/Setter Generation (continued)Slide 40Slide 41Add Unimplemented MethodsAdd Unimplemented Methods (continued)Slide 44Exception HandlingException Handling (continued)Slide 47Slide 48TasksTasks (continued)Slide 51Local HistoryLocal History (continued)SummaryIntroduction to EclipseOverview•Eclipse Background•Obtaining and Installing Eclipse•Creating a Workspaces / Projects•Creating Classes•Compiling and Running Code•Debugging Code•Sampling of Features•SummaryWhat is Eclipse?•Eclipse started as a proprietary IBM product (IBM Visual age for Smalltalk/Java)–Embracing the open source model IBM opened the product up•Open Source–It is a general purpose open platform that facilitates and encourages the development of third party plug-ins•Best known as an Integrated Development Environment (IDE)–Provides tools for coding, building, running and debugging applications•Originally designed for Java, now supports many other languages–Good support for C, C++–Python, PHP, Ruby, etc…Prerequisites for Running Eclipse•Eclipse is written in Java and will thus need an installed JRE or JDK in which to execute–JDK recommendedEclipse on GL•This years coordinated release (known as Ganymede) of the Eclipse IDE for Java Developers has been installed on GL–From any of the Linux machines in the labs simply run the command eclipseObtaining Eclipse•Eclipse can be downloaded from…–http://www.eclipse.org/downloads/packages/–Be sure to grab “Eclipse IDE for Java Developers”•Eclipse comes bundled as a zip file (Windows) or a tarball (all other operating systems)–Some versions of Linux (i.e. Fedora, Ubuntu) offer Eclipse in their respective repositories and can be downloaded using the appropriate tool (i.e. yum, apt-get)Installing Eclipse•Simply unwrap the zip file to some directory where you want to store the executables•On windows–I typically unwrap the zip file to C:\eclipse\–I then typically create a shortcut on my desktop to the eclipse executable •C:\eclipse\eclipse.exe•Under Linux–I typically unwrap to /opt/eclipse/Launching Eclipse•Once you have the environment setup, go ahead and launch eclipse•You should see the following splash screen…Selecting a Workspace•In Eclipse, all of your code will live under a workspace•A workspace is nothing more than a location where we will store our source code and where Eclipse will write out our preferences•Eclipse allows you to have multiple workspaces – each tailored in its own way•Choose a location where you want to store your files, then click OKWelcome to Eclipse•The first time you launch Eclipse, you will be presented with a welcome screen•From here you can access an overview to the platform, tutorials, sample code, etc…•Click on the arrow on the right to get to the actual IDEEclipse IDE ComponentsMenubarsFull drop down menus plus quick access to common functionsEditor PaneThis is where we edit our source codePerspective SwitcherWe can switch between various perspectives hereOutline PaneThis contains a hierarchical view of a source filePackage Explorer PaneThis is where our projects/files are listedMiscellaneous PaneVarious components can appear in this pane – typically this contains a console and a list of compiler problemsTask List PaneThis contains a list of “tasks” to completeCreating a New Project•All code in Eclipse needs to live under a project•To create a project: File  New  Java ProjectCreating a New Project (continued)•Enter a name for the project, then click FinishCreating a New Project (continued)•The newly created project should then appear under the Package ExplorerThe src folder•Eclipse automatically creates a folder to store your source code in called srcCreating a Class•To create a class, simply click on the New button, then select ClassCreating a Class (continued)•This brings up the new class wizard•From here you can specify the following...–Package–Class name–Superclass–Whether or not to include a main–Etc…•Fill in necessary information then click Finish to continueThe Created Class•As you can see a number of things have now happened…Directory structure for package and actual java file created automaticallySource is loaded into the editor pane, already stubbed outSource displayed in a hierarchical fashion listing each method nameCompiling Source Code•One huge feature of Eclipse is that it automatically compiles your code in the background–You no longer need to go to the command prompt and compile code directly•This means that errors can be corrected when made–We all know that iterative development is the best approach to developing code, but going to shell to do a compile can interrupt the normal course of development–This prevents going to compile and being surprised with 100+ errorsExample Compilation Error•This code contains a typo in the println statement…Packages/Classes with errors are marked with a red XOften Eclipse may have suggestions on how to fix the problem – if so, a small light bulb will be displayed next to the line of offending codeError underlined with red squiggly line (just like spelling errors in many word processors)Methods with errors are marked with a red XPosition in file is marked with a red line – 1 click allows you to jump to line with errorThe Problems tab will contain a tabular representation of all errors across all files of all open projectsExample Compilation Error (continued)•When clicking on the light bulb, Eclipse suggests changing printn to either print or printlnRunning Code•An easy way to run code is to right click on the class and select Run As  Java ApplicationRunning Code


View Full Document

UMBC CMSC 341 - Introduction to Eclipse

Download Introduction to Eclipse
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Introduction to Eclipse and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Introduction to Eclipse 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?