|
|
|||||||||||||||||||||||||
This how-to document was created using the Windows operating system. If you are using an operating system other than Windows, please contact me.
This version of the How to download and install JDK deals specifically with Java(TM) 2 SDK, Standard Edition, v 1.3.1_01 - it is the latest release known by me to be stable. Even though it is Java 2 SDK, v 1.3.1_01 it is more commonly referred to as Java 1.3.
Choose and download your OS specific Java Standard Development Kit 1.3 from here: http://java.sun.com/j2se/1.3/.
Microsoft Windows user go straight here: http://java.sun.com/j2se/1.3/download-windows.html.
Try to avoid the ads for different IDE's (BlueJ will do nicely - but that comes afterwards) and hit the Continue button.
Accept to the license agreement.
Whether you went for an FTP download or a HTTP download, the file is large. Note the file size shown on the page because you will need to check if it is indeed the right size (you will have to try again if it is not).

Click on an FTP or HTTP download button.
If you choose the HTTP download (it seems to be faster for me), be aware that you actually go through three screens to get to the actual download.. these screens are completely unnecessary as far as us users are concerned.
Select the Open radio button and click OK.

Again, select the Open radio button and click OK.

Now you get to the business end of the download - select the Save radio button and click OK.

Save the file!

Once you have finished the download, check to see if it is the right size.This one is the right size - 38,484,291 bytes. Right-click on the file and select Properties to see this.

Double click on the file to execute the installer.
The next two dialog boxes are just to ensure you understand what you are installing. If you want Java in your system, click Next.

Then click Yes (read the Binary Code License Agreement if you are unsure).

This is perhaps the most important step - choosing your JDK home directory. The default is shown in this graphic and unless you have a specific reason not to, you are advised to leave it as is. If you do change it, make sure that the new path does not contain spaces - you will have problems compiling and running Java files if you have spaces in the name.

My JDK home directory is C:\jdk1.3.1_01. Whatever yours is, note it down on paper - it will be needed shortly.
Choose what components you would like to have in your JDK installation. If you are low on hard disk space, you can save about 25 megabytes on your hard-drive by un-checking "Demos" and "Java Sources" - these are handy options but not necessary for your work in this subject.

Press Next to accept your selection and continue the process.
If all has gone well, you have succesfully installed Java!

Click Finish and we are ready to fix up your environment variables.
If you are using Windows 2000 or XP please contact me if these steps do not work for you.
If you look in the bin folder of your JDK home directory (typically C:\jdk1.3.1_01\bin, you will see some .exe files, including javac.exe and java.exe. These are the files that are run (executed) whenever you compile or run a .java or .class files (respectively).
Whenever you issue the java or javac command on a DOS command line, Windows first looks in the current directory for javac.exe and java.exe. Unless you are doing all your programming in C:\jdk1.3.1_01\bin (not recommended!) you will get a "bad command or file not found" error message from the command line unless Windows knows to look in C:\jdk1.3.1_01\bin.
This is what your environment variables do. Environment variables store a set of files and/or paths - whenever a command is issued to run a file that the OS cannot find in the current directory, it will search through the paths stored in the environment variable. This is how we get JDK to work on your system.
The following is an excerpt from an article on the Microsoft Knowledge Base entitled: HOW TO: Manage Environment Variables in Windows XP (Q310519). Also try here, a pictorial from Elizabeth.
This step-by-step article describes how you can manage the environment variables in Windows XP. Environment variables are strings that contain information about the environment for the system, and the currently logged on user. Some software programs use the information to determine where to place files (such as temporary files). During installation, Windows XP Setup configures the default system variables, such as the path to the Windows files.
You must be an administrator to modify a system environment variable. System environment variables are defined by Windows and apply to all computer users. Changes to the system environment are written to the registry, and usually require a restart to become effective.
Any user can add, modify, or remove a user environment variable. These variables are established by Windows XP Setup, by some programs, and by users. The changes are written to the registry, and are usually effective immediately. However, after a change to user environment variables is made, any open software programs should be restarted to force them to read the new registry values. The common reason to add variables is to provide data that is required for variables that you want to use in scripts.
To view or change environment variables:
Right-click My Computer , and then click Properties .
Click the Advanced tab.
Click Environment variables .
Click one the following options, for either a user or a system variable:
Click New to add a new variable name and value.
Click an existing variable, and then click Edit to change its name or value.
Click an existing variable, and then click Delete to remove it.
Look for your autoexec.bat file. It will be here:
C:\autoexec.bat
Open that file using a text editor such as Notepad. Find the line beginning with this:
PATH=
Change it so that it now begins with the current directory followed by the full path to the bin directory in your JDK Home Directory. On my installation I will be changing my autoexec.bat so that the PATH line begins with this:
PATH=.;C:\jdk1.3.1_01\bin;
Note that the ".;" at the start indicates the current directory (so the system will begin its search for the program you want in the current directory).
Save the file, close it and reboot your machine.
Windows 98 SE and Windows ME users may not have an autoexec.bat file.. see Beyond Windows 95.
Microsoft is slowly leaving behind DOS and thus the once ubiquitous autoexec.bat file is going too! autoexec.bat files will still be used on Windows 98 SE and Windows ME machines if you create one, but it is cleaner to use another facility provided for you already: msconfig.exe.
Click Start | Run as shown below.

This opens the Run dialog box. Enter "msconfig" into the Run dialog and press OK to run the program.

Now you should see msconfig - the System Configuration Utility.

Select the Environment tab, select the PATH environment variable and click Edit and go to step Eleven. If you do not have a PATH environment variable in the Environment tab, click New to create one.
Click New.

The new variable is to be called PATH and the value of PATH will be the current directory followed by the full path to the bin directory in your JDK Home Directory. On my machine I will enter details as shown below.

Variable Name: PATH
Variable Value: .;C\jdk1.3.1_01\bin;
Click OK to accept the new variable. You will be brought back to the System Configuration Utility. Click OK and the system will ask you to reboot now or not. If you have unsaved work, click No to this, save your work and then reboot. Otherwise, click Yes.
This step is pretty much the same as the step above to create a new environment variable, except that you will be editing the value of an existing environment variable. Prepend the PATH variable value with the current directory followed by the full path to the bin directory in your JDK Home Directory. On my machine I will enter details as shown below.

I have prepended the following.
Variable Value: .;C\jdk1.3.1_01\bin;
Congratulations! You now have Java.
These pages were created by Robert Mark Bram using Macromedia DreamWeaver UltraDev 4.0.
Have something to ad? Comments or corrections? Tell me about it now!