Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

AhmadLang / Java, How To Program, 2004

.pdf
Скачиваний:
588
Добавлен:
31.05.2015
Размер:
51.82 Mб
Скачать

[Page lvii (continued)]

Hardware and Software Requirements to Run JDK 5.0

To install and run JDK 5.0, Sun recommends that PCs meet the following minimum requirements:

500 MHz, Pentium III processor

[Page lviii]

256 MB RAM

100 MB of available disk space

[Note: the JDK is available for Windows, Linux and Solaris Operating Systems.]

[Page lviii (continued)]

Copying and Organizing Files

All of the examples for Java How To Program, Sixth Edition are included on the CD that accompanies this textbook. Follow the steps in the next section, Copying the Book Examples from the CD, to copy the examples directory from the CD onto your hard drive. We suggest that you work from your hard drive rather than your CD drive for two reasons: The CD is read-only, so you cannot save your applications to the book's CD, and files can be accessed faster from a hard drive than from a CD. The examples from the book are also available for download from:

www.deitel.com

www.prenhall.com/deitel

Screen shots in the following section might differ slightly from what you see on your computer, depending on whether you are using Windows 2000 or Windows XP, or your version of Internet Explorer.

[Page lviii (continued)]

Copying the Book Examples from the CD

1.Inserting the CD. Insert the CD that accompanies Java How To Program, Sixth Edition into your computer's CD drive. The window displayed in Fig. 1 should appear. If the page appears, proceed to Step 3 of this section. If the page does not appear, proceed to Step 2.

Figure 1. Welcome page for Java How to Program CD.

(This item is displayed on page lix in the print version)

[View full size image]

2.Opening the CD directory using My Computer. If the page shown in Fig. 1 does not appear, double click the My Computer icon on your desktop. In the My Computer window, double click your CD-ROM drive (Fig. 2) to access the CD's contents. Proceed to Step 4.

Figure 2. Locating the CD-ROM drive.

(This item is displayed on page lix in the print version)

[View full size image]

3.Opening the CD-ROM directory. If the page in Fig. 1 does appear, click the Browse CD Contents link (Fig. 1) to access the CD's contents.

4.Copying the examples directory. Right click the examples directory (Fig. 3), then select Copy. Next, go to My Computer and double click the C: drive. Select the Edit menu's Paste option to copy the directory and its contents from the CD to your C: drive. [Note: We save the examples to the

C:drive and refer to this drive throughout the text. You may choose to save your files to a different drive based on your computer's set up, the setup in your school's lab or personal preferences. If you are working in a computer lab, please see your instructor for more information to confirm where the examples should be saved.]

Figure 3. Copying the examples directory.

(This item is displayed on page lx in the print version)

[View full size image]

The book example files you copied onto your computer from the CD are read-only. Next, you will remove the read-only property so you can modify and run the examples.

[Page lviii (continued)]

Changing the Read-Only Property of Files

1.Opening the Properties dialog. Right click the examples directory and select Properties from the menu. The examples Properties dialog appears (Fig. 4).

Figure 4. examples Properties dialog.

(This item is displayed on page lx in the print version)

[Page lxi]

2.Changing the read-only property. In the Attributes section of this dialog, click the box next to Read-only to remove the check mark (Fig. 5). Click Apply to apply the changes.

Figure 5. Unchecking the Read-only check box.

[View full size image]

3.Changing the property for all files. Clicking Apply will display the Confirm Attribute Changes window (Fig. 6). In this window, click the radio button next to Apply changes to this folder, subfolders and files and click OK to remove the read-only property for all of the files and directories in the examples directory.

Figure 6. Removing read-only for all the files in the examples directory.

[View full size image]

Before you can run the applications in Java How To Program, Sixth Edition or build your own applications, you must install the Java Development Kit (JDK) 5.0 or another Java development tool. The following section describes how to install JDK 5.0.

[Page lxii]

Installing the J2SE Development Kit (JDK)

1.Locating the JDK installer. At the time of publication, the JDK 5.0 was still in beta releases and being updated frequently. As a result, the JDK installer might not be included on the CD that accompanies your book. If this is the case, you can download the most recent version of the installer from Sun's Web site. Go to java.sun.com/j2se/5.0/download.jsp and click the DOWNLOAD link in the SDK column. You must accept the license agreement before downloading. Once you accept the license agreement, you are directed to a download page, where you can select and download the installer for your computer platform. Save the installer on your hard disk and keep track of where you save it. The following steps show the installation procedure on the Windows platform.

2.Starting installation of the JDK. After either downloading the JDK installer or locating it on the CD that accompanies the book, double click the installer program to begin installing the JDK. The InstallShield Wizard window (Fig. 7) is displayed. Wait for the wizard to finish the configuration.

Figure 7. InstallShield Wizard for the JDK.

3.Accepting the license agreement. Carefully read the license agreement. Select Yes to agree to the terms (Fig. 8). [Note: If you choose not to accept the license agreement, the software will not install and you will not be able to execute or create Java applications.]

Figure 8. JDK license agreement.

[View full size image]

[Page lxiii]

4.Choosing the installation directory for the JDK. Select the directory in which you want the JDK to be installed (Fig. 9). If you change the default installation directory, be sure to write down the exact name and location of the directory you choose, as you will need this information later in the installation process. After selecting a directory, click the Next > button to install the development tool.

Figure 9. Choosing the destination location.

[View full size image]

5.Choosing the installation directory for the Java Runtime Environment (JRE). Select the directory in which you want the JRE to be installed (Fig. 10). We recommend that you choose the default installation directory. After you have selected a directory, click the Next > button to install the JRE.

Figure 10. Selecting the components of the JDK to install.

[View full size image]