
Java is everywhere, and can be found running inside devices as diverse as computers, PDA's, mobile devices and games consoles. It is a programming language that has been in development by Sun Microsystems for almost a decade, and has been used to create a wide range of applications, from games, to word processors, to barcode printing software for large postal organisations. Sun developed Java to be intelligent enough to detect when new versions of the software have been released, configuring it to automatically download and install the latest code on the user's computer with the minimum of fuss and user input. However, it is surprisingly difficult to "roll back" Java to a previous version; indeed, there is no obvious way to do this from a Windows PC.
Firstly, why would you want to revert to a previous version of Java? After all, the whole point of the automatic download system is to make sure users' systems are refreshed with the must current bug fixes and security updates. Yet, whilst as a developer your computer may be carefully patched with the latest Java runtime environment, it is more likely that your customer's computer will be working with a considerably older version, and there are a number of reasons for this.
The first is that many organisations operate a policy of purposefully adhering to one particular version of Java. A practical benefit of this is ensuring that any new Java programs developed internally are compatible across a current network. Many companies insist, for example, on Java applets and applications being compatible as far back as Java version 1.3. Similarly, many users will disable Java's auto-update feature when given the choice, either through mistrust, or to save bandwidth and time. Another issue, ironically, arises because of one of Java's main selling points: its objective of being "write once, run everywhere". This means that a piece of Java code written on a Windows PC should also work flawlessly on an Apple Mac, a Unix box, a mobile telephone etc. However, this is not necessarily the case, particular with respect to the Apple version of the Java runtime environment.
At the time of writing, Sun's Java 1.6 specification had been the accepted standard for quite some time. Although Java 1.6 was quickly available to run on PC and UNIX, Apple chose not upgrade immediately, instead staying with the older 1.5 standard. In fact, at the time of writing, Java 1.6 is only available on a minority of Apple computers. This means there is a schism between Apple users and the rest of the IT community. Java applets developed to run under Java 1.6 will almost certainly not run on most Apple Mac's.
All of these issues present a problem for the developer, and the need to be able to compile and check code under a previous version of Java is clear. However, there is no obvious method by which to do so on a modern PC. There is no control panel option in Windows to go back to a previous version of Java, and Sun's Java download page will only install the very latest version of the Java runtime environment. So how do you "roll back" to a previous version of Java to test applets you have developed?
It is, in fact, possible to download and revert to any previous version of the Java runtime environment. Nearly every version of Java ever released can be downloaded from http://java.sun.com/products/archive/index.html and installed on your machine, whatever the platform. Therefore if your employer requires that you use Java 1.3, there is no problem installing the correct runtime and checking your Java application, whether that version came pre-installed on your machine or not. To then select the correct Java runtime on a Windows PC, you will need to enter the Control Panel. Click on Programs, and then select Java to bring up the Java Control Panel. Click on the Java tab at the top of the page, and then select "View" to look at the Java applet runtime settings. This will present you with a complete list of all the Java runtime environments that are installed on your machine. To use one in particular, deselect all items in the list except the one you wish to use. When you are finished, reselect them all to return to your normal development environment.
Using this method you can successfully test your applets in a range of Java runtime environments.
Source: http://www.goarticles.com/