Question

When converting older Java software written for JDK1.0 to run on a newer JVM, are there any issues I should be aware of? Are all future versions of Java guaranteed to be backwards compatible?

Answer

While there have been significant improvements to the Java platform over the years in the terms of graphics, networking, performance, and other API enhancements, older software can't take advantage of these so many developers find themselves faced with the task of upgrading software. Or, as often happens, a machine running an earlier JVM for some critical application is upgraded, and a newer release is installed. How can you guarantee that there won't be any problems with your older software? Or is it safe to assume that all versions of Java are guaranteed to be backwards compatible?

It's never safe to make any assumption when it comes to JVMs. There are just too many vendors, and too many versions to keep track of. Beyond vendor incompatibilities though, there are some issues to be careful of when moving from JDK1.02 to JDK1.1, and from JDK1.1 to Java 2.

Firstly, and this is the most important, be mindful of deprecated methods. A method that has been marked as deprecated means that Sun no longer recommends using it and that an alternate mechanism should be used if at all possible. Please see an earlier FAQ on this topic located here. Remember also that if you want your new programs to run on older JDK1.0 machines, you must continue to use the deprecated methods and not newer ones that JDK1.0 is not aware of.

Secondly, there are many minor changes to the JDK tools, and JVMs, that will cause problems with older software. Generally this happens because of minor flaws in the original source code of the application, and as the JVM has improved it has become more strict. As a general rule, you shouldn't have much of a problem, but in the documentation that ships for JDK1.2 there are quite a few areas identified where problems can arise with older code. These are listed in the JDK 1.2 compatibility guide (see below).

Sun documentation on compatibility problems

For JDK1.1, please see http://java.sun.com/products/jdk/1.1/compatible/index.html

For JDK 1.2, which identifies numerous problems which Java 2 has with older code, please see
http://java.sun.com/products/jdk/1.2/compatibility.html


Back