The Java Developer's Guide to Eclipse The Java Developer's Guide to Eclipse

Welcome to the companion CD-ROM for The Java™ Developer's Guide to Eclipse, Second Edition by Jim D'Anjou, Scott Fairbrother, Dan Kehn, John Kellerman, and Pat McCarthy. To preview the CD-ROM, open the Table of Contents with a standard Web browser.

Read Me Contents

General Information
Installing Eclipse
Browsing the Online Documentation
Navigating the Exercise Templates and Solutions
Importing the Java and Plug-in Examples, Exercises, and Solutions
Installing the Features
Accessing the Eclipse 3.0 CD Content

Errata for Eclipse 3.2 CD Update

See the Errata for a description of the objectives and key changes in the CD update for Eclipse 3.2.

General Information

The website for the book is: www.jdg2e.com. Errata since the book was published can be found here.

This CD-ROM contains the following:

  1. Eclipse SDK, version 3.2.1
  2. Eclipse Examples, version 3.2.1 for Windows
  3. Your guide to this CD-ROM: The Java Developer's Guide to Eclipse online documentation
  4. Exercise template files and solutions
  5. Examples and tools.

We recommend that you first read Chapter 1, Read Me First, and the "Your First Steps" section of Chapter 2, Getting Started with Eclipse, before proceeding to install and use Eclipse.

This CD-ROM includes many Java and plug-in development projects that you will need to import into your workspace to view and/or work with. You can choose to do this all at once, or selectively as you need the projects. See the descriptions for each chapter or exercise for more information on the specific projects the chapter or exercise references.

Installing Eclipse

The Eclipse SDK for Windows version 3.2.1, which includes the required Java Development Tools and the Plug-in Development Environment, is on this CD-ROM. Other versions of the Eclipse SDK and more examples are available in the downloads section of eclipse.org. Eclipse requires a Java Runtime Environment (JRE) to be installed on your computer at level 1.4.2 or higher. The eclipse.org downloads section includes a table of available JREs from IBM and Sun.

Version Build Examples
3.2.1 eclipse-SDK-3.2.1-win32.zip eclipse-examples-3.2.1-win32.zip

The exercise solutions and example projects on this CD-ROM were developed and tested using the above Eclipse SDKs.

To begin:

Unzip the Eclipse SDK to a folder or directory of your choice, for example d:\eclipse3.2.  If you are using a different version of Eclipse, name the directory accordingly. For the remainder of this document, we're going to assume you're using Eclipse 3.2 in d:\eclipse3.2.
To start Eclipse, go to the eclipse subdirectory of the folder in which you extracted the zip file (e.g., d:\eclipse3.2\eclipse) and run eclipse.exe.
(Optional) To install the Eclipse examples, first make sure you have stopped Eclipse. Then unzip the file containing the examples to the same directory you used for your Eclipse SDK installation. For example, if you installed the Eclipse SDK in d:\eclipse3.2 then extract the contents of the examples zip file to d:\eclipse3.2. There are two files common between these two zip files, which may result in prompts to overwrite the files. The files are the Eclipse end user agreement and the Common Public License. You can choose to overwrite or not, the files are the same.
If you installed the example plug-ins, start Eclipse, specifying the -clean command line option to request that the runtime look for new plug-ins (this is only necessary one time). The example plug-ins will be installed. For information on what the examples do and how to run them, look in the "Examples Guide" section of Eclipse's Platform Plug-in Developer Guide. You can open Eclipse's online help by selecting Help Contents from the Help menu.

We recommend that you read Chapter 2, Using Eclipse before proceeding.

Browsing and Installing the Online Documentation

Your guide to the contents of the CD-ROM is — what else — an Eclipse plug-in included on the CD-ROM. You have three choices for viewing this information:

Using the Help System from the Eclipse SDK

There are two ways to install the online documentation in the Eclipse SDK. You can install the documentation plug-in as a feature using Eclipse Update Manager. This is the recommended approach and it is very easy. See Installing the Features for this guidance. 

You can also copy the documentation plug-in as described in the steps below but it's hacking and is not a recommended practice.

Shutdown Eclipse.
Copy the com.ibm.jdg2e.doc.isv_3.2.0 plug-in from e:\infocenter\eclipse\plugins folder, where e: is your CD-ROM drive, to <inst_dir>\eclipse\plugins, where <inst_dir> is your Eclipse installation directory. For example, if you installed Eclipse to d:\eclipse3.2, this would be d:\eclipse3.2\plugins.

Copying the infocenter plug-in

In order for Eclipse to recognize the plug-in, you need to reset the configuration information. This is the information Eclipse maintains in the folder eclipse\configuration. Do this by starting Eclipse with the -clean command line parameter. You only need to use the -clean parameter the first time.

eclipse.exe -clean
Select Help > Help Contents. Ta-da!

Eclipse Help System

Running the Eclipse Help System as a Web Browser-Based Infocenter

You can also run the Eclipse Help System as an infocenter. That is, you can run it stand-alone, on your computer or another one, and access documents from any Web browser. You can even run the Eclipse Help System directly from the CD-ROM. If you prefer to browse the CD-ROM documentation directly without the infocenter, open the Table of Contents with a standard Web browser.

The book's infocenter includes the Eclipse SDK (3.0) online documentation.

Start the e:\infocenter\start-infocenter-server.bat batch file with e:\infocenter as the current directory, where e: is your CD-ROM drive. This will start a Tomcat Web server to run the infocenter interface.
After a brief pause, the infocenter should open in your browser. If it does not, open the URL http://localhost:8081/help in your browser to view the online documentation.
To stop the infocenter Web server, run the e:\infocenter\stop-infocenter-server.bat batch file with e:\infocenter as the current directory, where e: is your CD-ROM drive.

Note: By default, the Web server will use port 8081. You can choose another port by passing it as a parameter to start-infocenter-server.bat. For example, start-infocenter-server.bat 8090 would use port 8090; in this case, your would enter the URL http://localhost:8090/help in your Web browser to open the infocenter.

Navigating the Exercise Templates and Solutions

The Java Developer's Guide to Eclipse online documentation is organized as the book is organized. Each part and chapter has an overview. These summarize the chapter content and point to relevant code examples and exercises.

Help System Organization

Importing the Java and Plug-in Examples, Exercises, and Solutions

NOTE: The process has changed in this 3.2 edition of the CD. Please follow the instructions carefully.

All the code is contained in a single zip file on the CD named JDG2E_3.2.zip in the root directory of the CD. You will unzip this file from the CD to a location on your hard drive. You can then import the Java or plug-in projects of interest into your Eclipse workspace.

The import process is the same for both Java and plug-in projects. The unzipped projects are organized as follows:

Project layout of zip file

As you can see the Java projects are in the java_development folder and the plug-in projects are in the plug-in_development folder.

Prior to importing the Java projects we recommend that you read the "Getting Started with JDT" section of Chapter 3, Using Java Development Tools, before proceeding to import the Java exercises, templates and solutions. Compile errors are to be expected. See Chapter 3 and/or Readme.txt files in the projects.

Prior to importing the plug-in projects we recommend that you read the "Using the Plug-in Development Environment" section of Chapter 9, Getting Started: Plug-in Development and complete Exercise 6, Creating Your First Plug-in, before proceeding to import the plug-in exercises, templates and solutions.

Unzip the file on the CD named JDG2E_3.2.zip to a directory on your hard drive (Do not unzip them directly to the Eclipse plug-ins directory. They will not compile correctly.)
In Eclipse, select File > Import....
In the Import wizard select General, expand it, and select Existing Projects into Workspace.

In the Import Projects page of the wizard select Select Root Directory and enter the name of the directory where you unzipped file JDG2E_3.2.zip. You will see a list of projects to import. By selecting the root directory you are asking to have all the Java and plug-in projects loaded into your workspace (the Importwizard finds all valid projects in all subdirectories and places them in the project list). This may not be what you want. You might find it better to intall the Java projects into one workspace and the plug-in projects into another.  See the JDG2E_3.2 folder layout image above to decide what you want to import. Using the Browse button, select the directory you are interested in, examine the list of project to be imported, and select the ones you want, make sure you have checked Copy projects into workspace, and press Finish.

Import Existing Projects dialog

The selected projects will be imported into your workspace. Repeat steps 2 through 4 for any other projects you wish to import.

To learn more about the plug-ins you have imported, turn to this book's infocenter or open the Table of Contents.

Once you install the plug-in projects, if you want a simple way to disable the user interface entries these plug-in projects add to Eclipse, see Chapter 30, Using Capabilities to Manage Too Much of a Good Thing.

Installing the Features

An Eclipse update site is included on the CD-ROM. This can be used to install two features as part of your Eclipse SDK environment.

The JDG2E Tools plug-ins can be imported into your workspace as part of the example plug-ins (see Importing the Plug-In Projects), but as you may want to use these tools in your development environment we have also provided you with the options of installing these tools as part of your Eclipse development environment.

You can use the update site provided on the CD-ROM to install the JDG2E Online Documentation or JDG2E Tools features. The installation of both features will be shown, but you can choose to install one or both. The value of installing these tools using features is that you can later choose to disable or enable the features using the Product Configuration dialog.

Installing a JDG2E Feature from the CD-ROM Update Site

Use the Help > Software Updates > Find and Install... menu to open the Eclipse Install wizard.
Choose the Search for new features to install option and then select Next.
Select New Local Site... option. Using the dialog shown then browse to the update_site CD-ROM directory and select OK. The dialog should now reflect this new update site location. Select the site you just added by checking the check box.

JDG2E CD-ROM Update Site

Select Finish to start the search, when done a Search Results page will be displayed. Select one or more features to install.

JDG2E CD-ROM Update Site Feature Search

Select Next to reach the Feature License page. Accept the license.
Select Next to reach the Install Location page. The default chosen will add the features to the current directory tree for your Eclipse installation, or possibly another site that might exist in your configuration. We recommend selecting Change Location... to create a new install site, for example e:\Eclipse-Development/JDG2E_Tools.

Selecting features to install

Choose the install site you want to use for each feature. Once done, select Finish to start the install. A dialog will be shown with a warning about an unsigned feature (the use of signed features is optional). Select Install to start the actual install.
You will have to select Install once for each feature to be installed.
Once the install is complete a prompt will ask you how you want to proceed. You can either restart Eclipse or sometimes you can just choose to apply the changes dynamically. We recommend a restart.
Once Eclipse has restarted you can review the Product Configuration dialog (Help > Software Updates > Manage Configuration... to see the new feature(s) or just begin using these extensions. For usage guidance, see the project specific documentation:

This will also be in the Help system if you installed the JDG2E Online Documentation feature.


Accessing the Eclipse 3.0 CD Content

If you wish go use the original CD that matches to the content of the book, it is located on the CD as a zip file named JDG2E_3.0.zip.

Note: The CD-ROM contents are based on Eclipse version 3.2.1 running on Windows. Running on other versions or platforms may result in errors.

© Copyright International Business Machines Corporation, 2003, 2004, 2006. All Rights Reserved.
© Copyright 2005 by Pearson Education, Inc.

Code or samples provided herein are provided without warranty of any kind.

The Java Developer's Guide to Eclipse infocenter is Powered by Eclipse technology.