Using Eclipse
The first thing we need to do is set up the IDE for browsing and editing our Java source code. If you downloaded the standard Java developer version of Eclipse, it should be set up for Java development. If you chose another package, you may need to select Window → Open Perspective → Java to put Eclipse into the Java editing perspective. A perspective in Eclipse is an arrangement of different tools, menu bars, and shortcuts geared toward a particular kind of task, such as Java editing or source repository browsing. You can open additional tools and move things around to your liking, but the predefined perspectives give you a good start. Now the Learning Java examples appear in Eclipse, as shown in Figure A-2.
On the left is the Package Explorer. It shows a tree view of the Java packages, libraries, and resources of our project. Click the folder handles to expand the tree and see source folders for each chapter in the book.
The bottom area holds tabs related to Java editing. The tab that is open in Figure A-2, Problems, shows errors and warnings associated with our project code. Eclipse has already compiled our code in the background. In general, you don’t have to tell it to do so. You’ll also notice red Xs on some of the source folders and files. These files have errors. We’ll talk about why some of our examples are being flagged in a moment. The other tabs, Javadoc and Declaration, give information about the file we’re editing or the source code item selected. The Declaration ...