Java Reference
In-Depth Information
4.
On the “System Properties” window, click the “Environment Variables” button to display
the “Environment Variables” window (see Figure
A-16
).
Figure A-16.
Notice that the environment variables are broken up in User and System variables. System variables are universal
for all users on a computer. User variables are only valid for the particular user currently signed on to the computer.
If there is a System and User variable with the same name, the User variable value will override the System variable value.
To understand the importance of Environment variables to Java we have to explain a little about how Windows
(and many operating systems) “work”. When a user clicks an icon or a menu item, they are telling Windows to do
“something” (i.e., specifying a function/command) against “something” (i.e., a file). So clicking on the “Internet
Explorer” icon or menu item means the user is specifying run (i.e., the command) the iexplore.exe file stored in
C:\Program Files\Internet Explorer. This information was all specified when Internet Explorer was installed on the
computer. Thank you, Microsoft!
Notice that Windows had to be told every little detail—like the exact location of the file to be run. This exact
location and file name (C:\Program Files\Internet Explorer\iexplore.exe) is called a fully qualified file name. If a
fully qualified name is not specified, Windows does not search the entire system to find the file. Instead Windows
reads the environment variable PATH. PATH can hold many locations (separated by semicolons) and tells Windows
where to search whenever an executable file (i.e., a command) is specified. The CLASSPATH variable tells Windows
where to search whenever a Java class file is specified. As with the PATH variables, multiple path names (folders and
subfolders) can be defined for the CLASSPATH variable. The “Environment Variables” window allows users to define
a variable or edit an already existing variable.