Thursday, January 7, 2010

Installing Java on your PC


1 Downloading the Java Development Kit from the Sun Java web site for a PC

A free version of Java may be obtained from the Sun Web Site
http://java.sun.com/javase/downloads/index.jsp
Make sure that you down load the Development Kit and not just the Run Time Environment (JRE). The download file name should have an dk. in it, e.g. an appropriate version of the Java development Kit, as a I write this (7 May 2007), would be the SE Development Kit (JDK), JDK 6u1, with dowload file titles, jdk-6u1-windows-i586-p-iftw.exe (on-line installation) or jdk-6u1-windows-i586-p.exe (off-line installation).

2 Installing the Java Development Kit on your PC

Click on the downloaded executable file, e.g. jdk-6u1-windows-i586-p-iftw.exe (on-line installation) or jdk-6u1-windows-i586-p.exe, and follow the on-screen installation instructions. The Java Development Kit Folder will be installed in your C:\Program Files\Javafolder.

3 Setting the PATH to the Java Development Kit on MS Windows XP

For ease of use, e.g. to be able to compile and run programs in any folder on your C drive with simple javac and java commands, you need to set the PATH. To do this for MS Windows XP, NT and 2000:
  • Click on start;
  • Click on Control Panel;
  • Click on System;
  • Click on Advanced tab;
  • Click on Environmental Variables button;
    An Envionmental Variables Box will appear;
  • Click on the Path line in the lower System variables window so that it is outlined in blue;
  • Click on the edit button below the lower System variables window;
    An Edit System Variable Box will appear;
  • If the Path line, now in the edit window, does not end in a semi-colon(;) add a semi-colon to the end of the line
    Type, at the end of the Path line, the address to the Java Development Kit bin, e.g. if it is in a folder named jdk1.6.0_01 and if this is stored in the Program Files Java folder type C:\Program Files\Java\jdk1.6.0_01\bin at the end of the Path line;
    For different versions of the Develeopment Kit replace jdk1.6.0_01 with the appropriate folder name;
  • Click on the OK, set or apply button in the Edit System Variable box;
  • Click on the OK, set or apply button in the Environmental Variables box;
  • Click on the OK, set or apply button in the System Properties (Advanced) box;
  • To make the new Path effective type C:\autoexec.bat in the Command Prompt Window, i.e.
    C:\>C:\autoexec.bat
    or restart your PC.
If a Path to a Java Development Kit bin already exists amend it to correspond to your new downloaded folder.

0 comments: