How to install Java

How to install Java
A guide to setting up Java
Dreamhost Web Hosting
Main - - Contact Me

What is Java and why do I need it?
Java is a programming language that allows programs to be written that can then be run on more than one type of operating system. A program written in Java can run on Windows, UNIX, Linux etc. as long as there is a Java runtime environment installed. Some of the programs on this website have been written in Java, so you will need to install the Java runtime environment in order to run them.

Compare Hosting Plans - Web Hosting - VPS Hosting - Dedicated Hosting

My Books - IRC Hacks - Impossible Sudoku Photography - DoF Calculator - KiteCam - Stacking Teleconverters - F1 London - Tethered Shooting IRC Bots - PircBot IRC API - PieSpy IRC Bot - Comic Bot - SpeechBot - Monty Quotes - ReminderBot - LogBot Misc. Articles - Meaning of Jibble - M4 Su Doku - Computer Scrapbooking - Setting up Java - Bootable Java - Cookies in Java - CJ Residential Lettings - LG EPG Bug - Dynamic Graphs - Social Shakespeare - Current Cost Graphs - T-Gauge Railway Security Articles - O2 blow goats - IRC Analysis - NatWest PIN - MySpace Hotlinking - O2 Broadband Fail - Cyber Security Challenge Server Programs - JBouncer IRC Proxy - Jibble Web Server - Mini Web Server Internet/File Tools - Java Wake-on-LAN - WebTail - NetDraw - Chatbox PHP script - JLogTailer - UK Postcodes - SimpleFTP - Mortgage Calculator

Where can I download Java?
You can download version 1.4 of Java from If you want to be able to write your own Java programs that you can compile and run, then you must download the SDK (Software Developers Kit). If you just want to be able to run a Java program that has already been compiled, then you can get away with just downloading the JRE (Java Runtime Environment). Once you have decided which you need, download either the SDK or the JRE. Choose the download that is most suitable for your operating system.

Setting up Java
If you do not have Java installed already, follow the instructions provided with the download in order to install Java. Once Java has been installed, you will be able to run Java program by running the java executable that was installed. You may find it convenient to add the location of this file to your operating system's path variable, otherwise you will need to explicitly refer to the absolute location of java.

Setting up the path
Windows 2000/XP users may set their path by rightclicking on 'My Computer' and selecting 'Properties'. Under the 'Advanced' tab, there is a button that allows you to set the 'Environment variables'. Click on this and alter the 'Path' variable so that it also contains the path to the Java executable. For example, if you have

Dreamhost Web Hosting

1 of 3

9/27/2011 6:30 PM

How to install Java

Other Java Packages - J2ME MIDlets - EPS Graphics2D - HumanNumber - JMegaHal AI About - Software Licenses - Mailing list - Advertising - Some Pictures - Curriculum Vitae - Contact Me External Links - Jibble Photo Gallery - Jibble Forums - Google Landmarks - Jibble Shop - Free Books - FreeDict Dictionary - My Disk Sharing - Free Shakespeare Plays - Free Lens Hoods - Intershot Ltd - Bouverie Place

installed Java in c:\jdk and your path is currently set to C:\WINDOWS\SYSTEM32, then you would change your path to read C:\WINDOWS\SYSTEM32;c:\jdk\bin When you open a new command prompt, it will reflect these changes and allow you to run java programs by typing "java". If you have installed the SDK, then you will also be able to run "javac" to compile stuff. Windows 95/98/ME users may find that their path variable is stored in a different place. Edit the c:\autoexec.bat file and add the following line at the end: SET PATH=%PATH%;c:\jdk\bin (This also assumes that you have installed Java in c:\jdk) Linux, UNIX, Solaris, FreeBSD users must set their PATH variable to point to where the java binaries have been installed. Please refer to your shell documentation if you have trouble doing this. For example, if you use bash as your shell, then you would add the following line to the end of your .bashrc: export PATH=/path

Setting up the classpath
In addition to setting up the path, you also need to tell Java where to find compiled class files at runtime. You will probably want to set the classpath to include at least the current working directory (.) Eg: SET CLASSPATH=%CLASSPATH%;. The classpath can also contain other directories that may contain compiled class files. Note that if you are using classes that are contained inside a .jar file, you will need to specify the full path and name of this file in the classpath, rather than just the name of the directory it is contained within.

Copyright Paul Mutton 2001-2010

Java Documentation
You may optionally download the Java documentation, which includes API pages that explain in good detail how each Java class can be used.

People I know Adam Sampson Giles Radford Robbo Matthew Slowe Fred Barnes Paul Haine Charlotte Dymock Tim Bishop

Java Persistence Tools
OpenJPA, Toplink, Hibernate Suppt No Lock-in, Eclipse-Based

Search this site

2 of 3

9/27/2011 6:30 PM

How to install Java

Ben Charlton Niels Demoen Andy Secker Jonathan Stott Joanna Dymock Paul Osborne Sophie Henderson


Copyright Paul Mutton 2001-2010 Feedback welcomed

3 of 3

9/27/2011 6:30 PM

Sign up to vote on this title
UsefulNot useful