Eclipse for Dummies.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
01_574701 ffirs.qxd 11/29/04 7:30 PM Page i Eclipse FOR DUMmIES‰ by Barry Burd 01_574701 ffirs.qxd 11/29/04 7:30 PM Page ii Eclipse For Dummies® Published by Wiley Publishing, Inc. 111 River Street Hoboken, NJ 07030-5774 Copyright © 2005 by Wiley Publishing, Inc., Indianapolis, Indiana Published by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, e-mail: [email protected]. Trademarks: Wiley, the Wiley Publishing logo, For Dummies, the Dummies Man logo, A Reference for the Rest of Us!, The Dummies Way, Dummies Daily, The Fun and Easy Way, Dummies.com, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book. LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REP- RESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CON- TENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDER- STANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPE- TENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMA- TION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ. For general information on our other products and services, please contact our Customer Care Department within the U.S. at 800-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. For technical support, please visit www.wiley.com/techsupport. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. Library of Congress Control Number: 2004116454 ISBN: 0-7645-7470-1 Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 1B/RW/RS/QU/IN 01_574701 ffirs.qxd 11/29/04 7:30 PM Page iii About the Author Dr. Barry Burd received an M.S. degree in Computer Science at Rutgers University and a Ph.D. in Mathematics at the University of Illinois. As a teach- ing assistant in Champaign-Urbana, Illinois, he was elected five times to the university-wide List of Teachers Ranked as Excellent by their Students. Since 1980, Dr. Burd has been a professor in the Department of Mathematics and Computer Science at Drew University in Madison, New Jersey. When he’s not lecturing at Drew University, Dr. Burd leads training courses for profes- sional programmers in business and industry. He has lectured at conferences in the United States, Europe, Australia, and Asia. He is the author of several articles and books, including JSP: JavaServer Pages, published by Wiley Publishing, Inc. Dr. Burd lives in Madison, New Jersey, with his wife and two children. In his spare time, he enjoys being a workaholic. 01_574701 ffirs.qxd 11/29/04 7:30 PM Page iv 01_574701 ffirs.qxd 11/29/04 7:30 PM Page v Dedication For e Katie, B njami nd n a a nd m a Je r n b n A i e , , e S i a n m n e a J n d d n R a , u t m h a , S H , t a e r i r Author’s Acknowledgments 01_574701 ffirs.qxd 11/29/04 7:30 PM Page vi Publisher’s Acknowledgments We’re proud of this book; please send us your comments through our online registration form located at www.dummies.com/register/. Some of the people who helped bring this book to market include the following: Acquisitions, Editorial, and Composition Services Media Development Project Coordinator: Maridee Ennis Project Editor: Paul Levesque Layout and Graphics: Andrea Dahl, Acquisitions Editor: Katie Feltman Lauren Goddard, Joyce Haughey, Copy Editor: Rebecca Senninger Barry Offringa, Lynsey Osborn, Jacque Roth, Heather Ryan, Julie Trippetti, Technical Editor: John Purdum Mary Gillot Virgin Editorial Manager: Kevin Kirschner Proofreaders: Leeann Harney, Joe Niesen, Media Development Manager: TECHBOOKS Production Services Laura VanWinkle Indexer: TECHBOOKS Production Services Media Development Supervisor: Richard Graves Editorial Assistant: Amanda Foxworth Cartoons: Rich Tennant (www.the5thwave.com) Publishing and Editorial for Technology Dummies Richard Swadley, Vice President and Executive Group Publisher Andy Cummings, Vice President and Publisher Mary Bednarek, Executive Acquisitions Director Mary C. Corder, Editorial Director Publishing for Consumer Dummies Diane Graves Steele, Vice President and Publisher Joyce Pepple, Acquisitions Director Composition Services Gerry Fahey, Vice President of Production Services Debbie Stailey, Director of Composition Services 02_574701 ftoc.qxd 11/29/04 7:32 PM Page vii Contents at a Glance Introduction .................................................................1 Part I: The Eclipse Landscape........................................7 Chapter 1: Reader, Meet Eclipse; Eclipse, Meet the Reader ........................................9 Chapter 2: Installing Eclipse............................................................................................19 Chapter 3: Using the Eclipse Workbench ......................................................................41 Chapter 4: Changing Your Perspective..........................................................................65 Chapter 5: Some Useful Perspectives and Views .........................................................83 Part II: Using the Eclipse Environment .......................103 Chapter 6: Using the Java Editor ..................................................................................105 Chapter 7: Getting Eclipse to Write Your Code...........................................................119 Chapter 8: Straight from the Source’s Mouse .............................................................137 Chapter 9: More Eclipse “Sourcery” ............................................................................155 Chapter 10: Refactoring: A Burd’s Eye View ...............................................................173 Chapter 11: Refactor This!.............................................................................................189 Chapter 12: Looking for Things in All the Right Places .............................................225 Part III: Doing More with Eclipse...............................249 Chapter 13: Working with Projects...............................................................................251 Chapter 14: Running Code.............................................................................................281 Chapter 15: Getting Help ...............................................................................................299 Chapter 16: Squashing Bugs..........................................................................................315 Part IV: The Part of Tens ...........................................323 Chapter 17: Ten Frequently Asked Questions (And Their Answers).......................325 Chapter 18: Ten Great Plug-Ins for Eclipse..................................................................331 Index .......................................................................335 02_574701 ftoc.qxd 11/29/04 7:32 PM Page viii 02_574701 ftoc.qxd 11/29/04 7:32 PM Page ix Table of Contents Introduction...................................................................1 Conventions Used in This Book ......................................................................2 What You Don’t Have to Read..........................................................................2 Foolish Assumptions.........................................................................................3 How This Book Is Organized............................................................................4 Part I: The Eclipse Landscape................................................................4 Part II: Using the Eclipse Environment .................................................4 Part III: Doing More with Eclipse ...........................................................5 Part IV: The Part of Tens.........................................................................5