Core Java® Volume I–Fundamentals



Download 37,53 Mb.
Pdf ko'rish
bet31/34
Sana06.01.2022
Hajmi37,53 Mb.
#325163
1   ...   26   27   28   29   30   31   32   33   34
Bog'liq
9780134177373-Vol-1

version

.

In this book, the installation directory is denoted as 



jdk

. For example, when

referring to the 

jdk

/bin


 directory, I mean the directory with a name such as

/opt/jdk1.8.0_31/bin

 or 

c:\Java\jdk1.8.0_31\bin



.

When you install the JDK on Windows or Linux, you need to carry out one addi-

tional step: Add the 

jdk

/bin


 directory to the executable path—the list of directories

that the operating system traverses to locate executable files.

On Linux, add a line such as the following to the end of your 



~/.bashrc

 or


~/.bash_profile

 file:


export PATH=

jdk

/bin:$PATH

Be sure to use the correct path to the JDK, such as 

/opt/jdk1.8.0_31

.



Under Windows, start the Control Panel, select System and Security, select



System, then select Advanced System Settings (see Figure 2.1). In the System

Properties dialog, click the Advanced tab, then click the Environment button.

Chapter 2

The Java Programming Environment



20

From the Library of Hristo Dimov Hristov




ptg18360597

Scroll through the System Variables list until you find a variable named 

Path

.

Click the Edit button (see Figure 2.2). Add the 



jdk

\bin


 directory to the beginning

of the path, using a semicolon to separate the new entry, like this:



jdk

\bin;


other stuff

Be careful to replace 



jdk

 with the actual path to your Java installation, such as

c:\Java\jdk1.8.0_31

. If you ignored the advice to drop the 

Program Files

 directory,

enclose the entire path segment in double quotes: 

"c:\Program Files\Java\

jdk1.8.0_31\bin";

other stuff

.

Save your settings. Any new console windows that you start will have the



correct path.

Figure 2.1

Setting system properties in Windows 7

Here is how you test whether you did it right: Start a terminal window. Type

the line

javac -version

and press the Enter key. You should get a display such as this one:

javac 1.8.0_31



21

2.1 Installing the Java Development Kit

From the Library of Hristo Dimov Hristov



ptg18360597

If instead you get a message such as “javac: command not found” or “The name

specified is not recognized as an internal or external command, operable program

or batch file”, then you need to go back and double-check your installation.

Figure 2.2

Setting the 

Path

 environment variable in Windows 7



2.1.3 Installing Source Files and Documentation

The library source files are delivered in the JDK as a compressed file 

src.zip

. Unpack


that file to get access to the source code. Simply do the following:

1.

Make sure the JDK is installed and that the 



jdk

/bin


 directory is on the

executable path.

2.

Make a directory 



javasrc

 in your home directory. If you like, you can do this

from a terminal window.

mkdir javasrc

Chapter 2

The Java Programming Environment



22

From the Library of Hristo Dimov Hristov




ptg18360597

3.

Inside the jdk directory, locate the file 



src.zip

.

4.



Unzip the 

src.zip


 file into the 

javasrc


 directory. In a terminal window, you can

execute the commands

cd javasrc

jar xvf 


jdk

/src.zip


cd ..

TIP: The 

src.zip


 file contains the source code for all public libraries. To obtain

even more source (for the compiler, the virtual machine, the native methods,

and the private helper classes), go to 

http://jdk8.java.net

.

The documentation is contained in a compressed file that is separate from the



JDK. You can download the documentation from 

www.oracle.com/technetwork/java/javase/

downloads

. Simply follow these steps:

1.

Download the documentation zip file. It is called 



jdk-


Download 37,53 Mb.

Do'stlaringiz bilan baham:
1   ...   26   27   28   29   30   31   32   33   34




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish