4.2. Install Java
Warning:
It is
strongly
advised that you choose an installation directory that does
not
include spaces in the path name (e.g., do NOTinstall in
C:\Program Files\
). If Java is installed in such a directory, it is critical to set the
JAVA_HOME
environmentvariable to a path that does not include spaces (e.g.,
C:\Progra~1\
); failure to do this will result in exceptions thrown bysome programs that depend on the value of
JAVA_HOME
.
•
Run the executable downloaded above.
•
Change the installation directory to a path with no spaces in it, such as
C:\jdk_1.5.0_08
(
recommended; cf. warning, above
).
•
Accept all other installation defaults.
•
When the installer gets to the stage of installing the J2SE Runtime Environment it is okayto accept the default, e.g.,
C:\Program Files\Java\jre1.5.0_08
. During thisstage of the installation, it may be necessary to close some applications - e.g., Eclipse -that are running in a previously-installed version of the JRE; the installation programshould prompt appropriately.
•
Instructions for setting PATH and CLASSPATH and JAVA_HOME are given insummary below; in more detail in anappendixto this document; and also onSun's site.
• Add Java's bin directory (e.g.,
C:\jdk_1.5.0_08\bin
) to your PATHenvironment variable (more info in theEnvironment Variablesappendix on thispage). Make sure that references to older Java installations do not conflict with thenew version you have installed (e.g., if installation of an Oracle client placed areference to an old version of Java in your path you may need to do some carefulexperimentation and tweaking to appropriately set your path so all the applicationsyou need will run).• Set your CLASSPATH environment variable:• CLASSPATH should be set to "." (a period, and nothing more), unless you knowthat for some reason you need additional items in your CLASSPATH.• The theory here is that to include any user classes, you can use the -classpathcommand line switch with java, javac, javadoc and other tools; and CLASSPATHis not forced for multiple applications; alternately you can add more paths toCLASSPATH as necessary.• More about how to set the CLASSPATH can be found in theEnvironmentVariablesappendix on this page.• An environment variable called
JAVA_HOME
should be set to the root directory of your Java installation, e.g.,
C:\jdk_1.5.0_08
.
Please refer to the warning,above, re: installations to directories with spaces in the path name!
Java SE Installation Instructions
Page 3
Copyright © 2003-2007 University of California. All rights reserved.
Leave a Comment