|
System Requirements |
Installation Instructions |
Troubleshooting
The Java 2 SDK is intended for use on
Microsoft Windows 95,
98 (1st or 2nd edition), NT 4.0 with Service Pack 5, ME, 2000 Professional,
2000 Server, 2000 Advanced Server, or XP operating systems
running on Intel hardware.
A Pentium 166MHz or faster processor with at least 32 megabytes
of physical RAM is required to run graphically based applications.
Forty-eight megabytes of RAM is recommended for applets running
within a browser using the Java Plug-in product. Running with less
memory may cause disk swapping which has a severe effect on
performance. Very large programs may require more RAM for adequate
performance.
You should have 70 megabytes of free disk space
before attempting to install the Java 2 SDK
software. If you also want to install the
documentation download bundle, you will need an
additional 120 megabytes of free disk space.
Installation Instructions
In this procedure, you will run the self-installing executable to
unpack and install the Java 2 SDK software bundle.
Note: After the Java 2 SDK software has been installed,
you will be asked to reboot your system, which completes the
registry modifications that you will need if you ever want to deinstall
this product later. To continue using these
instructions after rebooting, either print them now or use your
Web browser's history function to get back to this page.
The installation procedure has the following steps:
- Check the download file size
- Run the Java 2 SDK installer
- Delete the downloaded file(s) (Optional)
- Update the PATH variable
- Check the CLASSPATH variable
- Start using the SDK tools!
- Uninstalling the Java 2 SDK
If you have any difficulties, see the Troubleshooting
section at the end of this document or use this link to report
an installation problem.
Note: For any lines on this page containing the following notation,
you must substitute the appropriate update version number for the notation.
<version number>
For example, if you are downloading the installer for update 1.3.1_01,
the following file name:
j2sdk-1_3_1_<version number>-windows-i586.exe
would become:
j2sdk-1_3_1_01-windows-i586.exe
1.
Check the download file size
Before you download a file, notice that its byte size is provided
on the download page.
Once the download has completed, check that you have downloaded the
full, uncorrupted software file.
2.
Run the Java 2 SDK installer
The file j2sdk-1_3_1_<version number>-windows-i586.exe is the Java 2 SDK installer. If you
downloaded it instead of running it directly from the
web site, double-click on the installer's icon. Then follow the
instructions the installer provides. When done with the installation,
you can delete the download file to recover disk space.
Installed Directory Tree
The Java 2 SDK has the directory structure shown below.
jdk1.3.1_<version number>
____________________|___________________
| | | | | | | | | |
| | | | bin lib | | demo |
| | | LICENSE | | | | jre
| | COPYRIGHT | | __|__
| README | include | |
README.html include-old bin lib
|
If you get an error about not having enough disk space even
though you clearly have enough, see the
troubleshooting section below.
3.
Delete the downloaded file(s) (Optional)
If you want to recover disk space, delete the file (or files) you
originally downloaded.
4.
Update the PATH variable
You can run the Java 2 SDK without setting the PATH variable,
or you can optionally set it as a convenience.
Should I set the PATH variable?
Set the PATH variable if you want to be
able to conveniently run the Java 2 SDK executables
(javac.exe, java.exe,
javadoc.exe, etc.) from any directory
without having to type the full path of the command.
If you don't set the PATH variable, you need to specify the
full path to the executable every time you run it, such as:
C:> \jdk1.3.1_<version number>\bin\javac MyClass.java
It's useful to set the PATH permanently so it will persist
after rebooting.
How do I set the PATH permanently?
To set the PATH permanently, add the full path of the
jdk1.3.1_<version number>\bin directory to the PATH variable.
Typically this full path looks something like
C:\jdk1.3.1_<version number>\bin. Set the PATH as follows.
Microsoft Windows NT and 2000 - To set the PATH permanently:
- Choose Settings, Control Panel, and select System. On Microsoft Windows NT,
select the Environment tab; on Microsoft Windows 2000 select the Advanced tab.
Look for "Path" in the User Variables and System Variables.
If you're not sure where to add the path, add it to the
right end of the "Path" in the User Variables. A typical value
for PATH is:
C:\jdk1.3.1_<version number>\bin
Capitalization doesn't matter. Click "Set", "OK" or "Apply".
The PATH can be a series of directories separated by
semi-colons (;). Microsoft Windows looks for programs in
the PATH directories in order, from left to right. You
should only have one bin directory for a Java SDK
in the path at a time (those following the first are
ignored), so if one is already present, you can update
it to jdk1.3.1_<version number>.
- The new path takes effect in each new Command Prompt window
you open after setting the PATH variable.
Microsoft Windows 98 and 95 - To set the PATH permanently,
open the AUTOEXEC.BAT file and add or change the PATH statement
as follows:
- Start the system editor. Choose "Start", "Run" and enter
sysedit, then click OK. The system editor starts
up with several windows showing. Go to the window that is
displaying AUTOEXEC.BAT.
- Look for the PATH statement. (If you don't have one, add one.)
If you're not sure where to add the path, add it to the
right end of the PATH. For example, in the following PATH
statement, we have added the bin directory at the right end:
PATH C:\WINDOWS;C:\WINDOWS\COMMAND;C:\JDK1.3.1_<version number>\BIN
Capitalization doesn't matter. The PATH can be a series of
directories separated by semi-colons (;). Microsoft Windows
searches for programs in the PATH directories in order, from
left to right. You should only have one bin directory
for a Java SDK in the path at a time (those following
the first are ignored), so if one is already present, you
can update it to jdk1.3.1_<version number>.
- To make the path take effect in the current Command Prompt window,
execute the following:
C:> c:\autoexec.bat
To find out the current value of your PATH, to see if it
took effect, at the command prompt, type:
C:> path
Microsoft Windows ME - To set the PATH permanently:
From the start menu, choose programs, accessories,
system tools, and system information. This brings up a window titled "Microsoft Help and Support".
From here, choose the tools menu, then select the system configuration utility. Click the
environment tab, select PATH and press the edit button. Now add the SDK to your path
as described in step b above. After you've added the location of the SDK to your PATH, save the changes
and reboot your machine when prompted.
Microsoft Windows XP - To set the PATH permanently:
From the start menu, open the Control Panel, and from there, double
click the System icon to open the System Control panel. If the System
icon is not visible, first click on the "Switch to Classic View" button.
In the System
control panel, select the Advanced tab, and then click the "Environment
Variables" button. This will bring up a window in which you can
edit system variables, including the PATH variable. After you've added
the location of the SDK to your PATH, save the changes
and reboot your machine when prompted.
In order to be recognized on some systems, the addition may need to be
added at the beginning of the variable list.
5.
Check the CLASSPATH variable
The CLASSPATH variable is one way to tell applications written in the
Java programming language (including the Java 2 SDK utilities) where
to look for user classes (classes that you develop).
(The -classpath command-line switch is the
preferred way.) If your machine does not have the CLASSPATH variable
set, you can ignore the rest of this step.
To check the setting, run the set command from the DOS prompt
(From the start menu, choose Command Prompt.):
C:> set
If CLASSPATH does not appear in the list of settings, it is not set.
If your CLASSPATH variable is set to some value, you may want to clean
up your CLASSPATH settings, so read on.
Should I modify the CLASSPATH variable?
The Java 2 SDK will work fine even if CLASSPATH is set for an earlier
version of the SDK software, as long as it contains the current
directory ".". However, if your CLASSPATH contains
classes.zip (which was only in JDK 1.0.x and JDK 1.1.x),
and you don't plan to continue using those earlier versions, you can remove
that setting from the CLASSPATH now. In any case, if CLASSPATH
is set, it should include the current directory --
this makes it possible to compile and then run classes in the current directory.
How do I modify the CLASSPATH?
Use the same procedure you used for the PATH variable
in the previous step and either:
- Remove the CLASSPATH environment variable entirely.
With Java 2 SDK, the default value is ".", the current directory.
To include any user classes, use the -classpath
command line switch instead with java, javac,
javadoc and other tools.
This is the recommended approach because it doesn't force one
CLASSPATH for all applications.
-OR-
- If you have applications that require CLASSPATH be set,
keep those required user classes in CLASSPATH
and include the current directory "
."
If you're no longer using JDK 1.1.x, remove classes.zip.
For more information, see
Setting the class path.
6.
Start using the Java 2 SDK!
Your computer system should now be ready to use the Java 2 SDK.
In this step, you'll run some simple commands to make sure it is working
properly.
If you are new to developing and running programs in the Java
programming language, see The Java Tutorial online for
some guidance. Note especially the tutorial trails under the
heading Trails Covering the Basics.
You can also download the Java 2 SDK documentation
from the Java 2 SDK download page..
7.
Uninstalling the Java 2 SDK
If you should ever want to uninstall the Java 2 SDK, go to the
Start menu and select Settings, then select Control Panel. In the
Control Panel, open the Add/Remove Programs utility. You will be
presented with a list of software that you can uninstall. Simply
choose the Java 2 SDK from the list and click the "Add/Remove..."
button.
Troubleshooting the Installation
Below are some tips for working around problems that are sometimes
seen during or following an installation. For more troubleshooting
information, see the Java FAQ.
- "Damaged" ActiveX Control file
When you install version 1.3.1_<version number> of the Java Runtime Environment,
the ActiveX Control file at C:\Winnt\Downloaded Program Files\Java Runtime Environment 1.3.1_<version number> will have a status of "Damaged."
This is merely a cosmetic issue, and the "Damaged" status should
have no adverse affect in any situation.
Nevertheless, there is a workaround if for some reason you cannot
have a status of damaged. Go to "Start -> Run" and
type in "regedit". From the regedit windows, navigate to the registry key
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Code Store Database\Distribution
Units\8AD9C840-044E-11D1-B3E9-00805F499D93\DownloadInformation".
Double-click on the INF string and delete the highlighted string under
"Value data". The ActiveX Control file will have a status
of "Installed."
- Installer says you don't have enough disk space,
even though you have more than 4GB free space available
This problem can occur if the free space on your disk is in the
narrow range [4GB, 4GB + required space -1]. To workaround this
problem, create a temporary file (or files) that take up enough
disk space to make the free space less than 4GB, then proceed
with the installation. After the installation is completed,
you may delete the temporary file(s).
A similar problem may occur with larger amounts of free disk space.
See bug report
4406594.
Another workaround for these types of problems is the use WinZip to
extract the contents of the j2sdk-1_3_1_<version number>-windows-i586.exe file, and then run the setup.exe executable from the
directory that is created by the extraction.
These types of problems should not exist with releases with
version number 1.3.1_03 or later.
- If you see the following error message on Microsoft Windows 2000,
config.nt. The system file is not suitable for running MS-DOS
and Microsoft Windows Applications.
it indicates a problem with the %SystemRoot%\System32\COMMAND.COM file that has
been seen on some installations of Microsoft Windows 2000.
If you encounter this error
message when you try to launch the installer, consult the Microsoft web site at
http://support.microsoft.com/support/kb/articles/Q142/2/71.asp
for information about resolving the problem.
- If you see the following error message
corrupt cabinet file
then the file you have downloaded is corrupted. (A cabinet file
contains compressed application, data, resource and DLL files.)
Check its file size against the expected file size listed in these
instructions. If they don't match, try downloading the
bundle again.
- If you see the following error message
net.socketException: errno = 10047
-or-
Unsupported version of Microsoft Windows Socket API
check which TCP/IP drivers you have installed. The AppletViewer
supports only the Microsoft TCP/IP drivers included with Microsoft Windows 95.
If you are using third-party drivers (e.g., Trumpet Winsock), you'll need
to change over to the native Microsoft TCP/IP drivers if you want to
load applets over the network.
- If you see the following error message
System Error during Decompression
then you might not have enough space on the disk that contains your
TEMP directory.
- If you see the following error message
This program cannot be run in DOS mode.
then do the following:
- Open the MS-DOS shell (Windows/Start/Programs/MS-DOS Prompt)
- Right-click on the title bar
- Select Properties
- Choose the Program tab
- Push the Advanced button
- Make sure the item "Prevent MS-DOS-based programs from detecting Windows"
is unchecked
- Select OK
- Select OK again
- Exit the MS-DOS shell
- Restart your computer.
- If the AppletViewer does not load applets
then you might try the following:
- set HOMEDRIVE=c:
set HOMEPATH=\
and restart the AppletViewer (in the same Command Prompt window)
- set HOME=c:\
and restart the AppletViewer (in the same Command Prompt window)
If none of these work, try:
java -verbose sun.applet.AppletViewer
This lists the classes that are being loaded. From this output, you
can determine which class the AppletViewer is trying to load and where it's
trying to load it from. Check to make sure that the class exists and
is not corrupted in some way.
- Appletviewer locks up
This happens with NT Workstation 4.0, update 3,
where the DISPLAY is configured for "true color".
The appletviewer (and perhaps other entities) will lock up by running and
then freezing the system consuming 100% CPU.
To "test" this run the "java -verbose sun.applet.AppletView"
and notice that it locks up when it tries to run the MTookit.class.
- Winsock Issues
The Java 2 SDK does not include
Microsoft Winsock 2.0. It is extremely likely that your system
already has Winsock 2.0. Microsoft Windows NT 4.0, ME, 2000, and 98
come with Winsock 2.0. Microsoft Windows 95 comes with
Winsock 1.1 or 1.2, but most Microsoft Windows 95 systems have been upgraded to
Winsock 2.0 by now.
To check which version of Winsock you have, search for "winsock.dll".
Then choose "Properties" from the File menu and click the Version tab.
You can download the Winsock 2.0 from this address:
http://www.microsoft.com/windows95/downloads/ contents/wuadmintools/s_wunetworkingtools/w95sockets2/
The following URL contains information about how to determine if
the Winsock 2.0 components are installed on a Microsoft Windows 95 platform:
http://support.microsoft.com/support/kb/articles/Q177/7/19.asp
- Creating Source Files in Notepad - In Microsoft Windows,
when you create a new file in Microsoft Notepad and then save it
for the first time, Notepad normally adds the
.txt
extension to the filename. Therefore, a file you name
Test.java is saved as Test.java.txt.
It's important to note that you cannot see the .txt
extension unless you turn on the viewing of file extensions
(In Microsoft Windows Explorer, uncheck "Hide file extensions for known file
types" under Folder Options). To prevent the .txt extension,
enclose the filename in quotation marks, such as
"Test.java", when typing it into the Save As dialog box.
On the other hand, Microsoft WordPad does not add a file extension if
you provide one -- you must save the file as "Text Document".
|