Debugger-Tutorial-Companion-Document
9 pages
Slovak

Debugger-Tutorial-Companion-Document

-

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
9 pages
Slovak
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

Ecli pse and Jav a: Using the Deb uggerComp anion Tutorial Docum entVersion 1.1 (Febru ary 17, 2 008)By M ark Dext erTable of Co ntentsIntrod uction & Setup..............................................................................................................1Playing the L essons........................................................................................................................2Closed Captions and Lesso n Table of Co ntents.................................................................................2Tutorial Target Aud ience.........................................................................................................2Tutorial Obj ectives.................................................................................................................2Tutorial Appro ach..........................................................................................................................3Getting The Most From This Tutorial.......................................................................................3Sample Java App lication – Pers onal L ending Li brary.............................................................3Downloading an d Insta lling Ec lipse....................................................................................................4L esson Outlin es.......................................................................................................................5Lesso n 1 .............. ...

Informations

Publié par
Nombre de lectures 596
Langue Slovak

Extrait

Ecli pse and Jav a: Using the Deb ugger Comp anion Tutorial Docum ent Version 1.1 (Febru ary 17, 2 008) By M ark Dext er Table of Co ntents Introd uction & Setup..............................................................................................................1 Playing the L essons........................................................................................................................2 Closed Captions and Lesso n Table of Co ntents.................................................................................2 Tutorial Target Aud ience.........................................................................................................2 Tutorial Obj ectives.................................................................................................................2 Tutorial Appro ach..........................................................................................................................3 Getting The Most From This Tutorial.......................................................................................3 Sample Java App lication – Pers onal L ending Li brary.............................................................3 Downloading an d Insta lling Ec lipse....................................................................................................4 L esson Outlin es.......................................................................................................................5 Lesso n 1 ............................................................................................................................5 Lesso n 2 ................5 Lesso n 3.............................................................................................................................5 Lesso n 4................5 Lesso n 5............................6 Lesso n 6................6 Lesso n 7................6 Genera l Resources.......................................................................................................................6 Ecli pse W ebsites..............................................................................................................6 Ja va W ebsites.................................................................................................................................6 Ecli pse Books ......................................................................................................................7 Ja va Books ..........................................................................................................................7 Alphabetical Index b y Lesson.....................................................................................................8 Introduction & Setu p This docum ent is designed to accompany the “Ecl ipse And Ja va: Using the D ebugger” v ideo tutorial, which is a vailable at http://eclipsetutor ial.sourc eforge.net/ . Before startin g this tutori al, please download the following fil es from the w ebsite: ● De bugger-T utorial-Com panion-Doc ument.PDF – this d ocument. ● debugger_tutorial_project.zip – zip file for importing the Ec lipse “D ebuggerTutorial” pro ject. This is don e as part of Lesso n 1. ● debugger-l esson01.zip throu gh deb ugger-l esson07.zip – zip fil es for the 7 lesso ns in the tutorial Cop yright © 2007 Mark Dexter . Licensed under the Educational Co mmunity License version 1.0. Page 1 of 9 Ec lipse a nd Java: Using the De bugger Tutorial Comp anion Document Playing the Lessons 1.Unzip each le sson's zip fil e into a directory on y our s ystem. 2.Find the file ca lled “l essonxx.h tml”, where x x is the lesso n number 0 1-07. 3.Open this file w ith your browser (e.g., Intern et E xplorer or Firefo x) and press the lar ge pla y button on the video thumbnail. The lesson sh ould p lay ins ide the bro wser. Note that you need to have the Ad obe Flash pl ayer insta lled o n your system. This can be d ownloaded from Adob e at http:// www.adobe.com/products/flashp layer/. Alternativel y, you can just ope n the fil e “lessonxx.s wf” w ith y our br owser. In W indows Internet E xplorer you might get a securit y w arning a nd need to click a nd select “All ow block ed content”. If you open the lessonxx.swf file dir ectly (as opposed to l essonxx.h tml), you can resiz e the video to any desired size, makin g it l arger or smal ler. Note that playing the v ideo from the less onxx.html file w ill provide the clear est ren dition of the v ideo but does not allow resiz ing. Closed Captions and Lesson T able of Contents The aud io track of each l esson can b e accompanied b y clos ed captio ns (subtitles), which display in the lo wer portion of the video. Press the “CC” button in the l ower rig ht cor ner to togg le them on and off. Each le sson als o contains a tabl e of contents that allows you to jump to a specified point ins ide the v ideo. To acc ess the tab le of co ntents, click o n the Table of Conte nts ico n in the lower right corner of the video. Nex t to the Table of Contents control is the V olume control. The controls are shown above. Tutorial T arget Audience This tutorial is targete d for pe ople wh o have com plete the tutorial “Ecl ipse an d Java for Total Beg inners” or w ho have some fami liarity w ith Ecl ipse an d Java. Completing the “Introducin g Persistenc e” tutorial is not necess ary but mi ght be helpful to b eginning Ecl ipse an d Java programmers. N o prior experie nce w ith the Ecli pse Java Deb ugger is n eeded for this tutoria l. Tutorial Objectives The obj ectives of this tutoria l are to:  Demonstrate how to use the Ecl ipse Ja va de bugger to step throug h a running Java progr am and e xamine the contents of the pro gram's v ariables Cop yright © 2007 Mark Dexter . Licensed under the Educational Co mmunity License version 1.0. Page 2 of 9 Ec lipse a nd Java: Using the De bugger Tutorial Comp anion Document  L earn some co ol tips and tricks abo ut the Ecli pse deb ugger  Use the debugger to look at object referenc e issues an d recursive metho ds in Ja va Tutorial Approach The tutorial is org anized around the following activities. W e w ill start wi th the M yLibrar y pro ject which was create d in the “Total Begi nners” an d “Introd ucing Pers istence” tutorials.  Import the M yLibrar y project  L earn bas ic debugger skil ls: step ping throu gh the code an d examining variabl es and expressions  Use the debugger to fix two pro gramming errors in the M yLibrar y class  Use the debugger to look at some Ja va progr amming concepts Co ncepts are introd uced as nee ded dur ing the deb ugging process. Getting The Most From T his Tutorial This tutorial ca n be used as an in-d epth dem onstration of the Ec lipse Java Debugger. However, if y ou want to learn how to use the debugger, the foll owing approach is recomme nded:  Have Ecli pse instal led an d ready to go.  Work si de-b y-side w ith the less ons, p ausing and re winding as nee ded.  Use this guide as needed.  Consult other res ources as nee ded to understand the topics covered i n greater depth.  Ke ep a positive attitude! Sample Java Application – Personal Lendin g Librar y This is a small sam ple ap plication to track our p ersonal library of books. It inc ludes a l ist of peo ple to whom we loan our books. The application has four Java classes: 1.Person h as fields for the person's nam e and a numb er which will be the maximum numb er of books this p erson can borr ow at one time. 2.Book has fie lds for title, author , and the perso n who is currentl y b orrowing the book. 3.M yLibrar y contains a l ist of al l of our bo oks and a list of all of the people w ho mi ght borrow them. It includes methods for checking books out to people and check ing them back in. It als o includes a ma in() method that simulates a user sess ion. In the ma in() method, a new M yLibrar y is created, books an d people are created a nd added to it, and some bo oks are checked out and check in. At v arious points, information about the M yLibrar y object is pri nted to the s ystem conso le. 4.M yUtilities contai ns methods to save and retrieve text files to and from disk as well as methods to save and retrieve a M yLibrar y ob ject to an d from a file i n serialized format. These m Cop yright © 2007 Mark Dexter . Licensed under the Educational Co mmunity License version 1.0. Page 3 of 9 Ec lipse a nd Java: Using the De bugger Tutorial Comp anion Document were developed in the “Introduc ing Persiste nce” tutorial. There are a lso t wo new metho ds added for this tutori al. Note that this application is ver y sim ilar to, but n ot the same, as the application we wrote in the Persistenc e tutorial. Here w e do not use the XStream X ML library that w e use d in the Persistence tutorial, an d we have removed all of the methods that depended o n this l ibrary. Als o, this pro ject by design contai ns some bugs that we w ill fi x during the course of this tutori al. Downloading and Installing Eclipse Before Install ing Ecli pse, you need to have the Ja va JDK (Java develo pment kit) installed on y our computer. This are a vailable at http://ja va.sun.com/javase/do wnloads/index .jsp. IMPOR TANT NOTE: You ne ed to install Java version 1.5 or later to run the tutorial. Version 1.6 (Java 6) is recomme nded, since this su pports all of the latest Ec lipse Java Debugger features. Ja va versions prior to 1.5 do not supp ort ge nerics (use d in the M yLibrar y pr oject) or the JUnit 4.0 unit test frame work. Also, altho ugh y ou can ru n Ec lipse wi th the JRE, w e n eed the JDK for this tutoria l, since we'll be using the de bugger-ena bled version of the JRE that comes wi th the JDK. Install ing the JDK is reaso nably sim ple. Detai led, step-b y-step instructi ons, if ne eded, are availab le in the PDF Ec lipse Tutorial at the https:// www.arc
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents