Main Content

Choosing the right version of Java and Tomcat

Archive - Originally posted on "The Horse's Mouth" - 2009-05-16 07:47:33 - Graham Ellis

Java is described as being a portable language. But that only means that the 'runnable' class files are fairly portable - you must download and install the correct Java Virtual Machine / Java Runtime Environment / Java Development Kit for your computer / operating system / needs.

This diagram shows you the choices you make in deciding which version is right for you.

• Which Distribution do you need - Sun's? IBM's? The Gnu version? Typically, Sun's version is the one we use, as we're heavily into the Tomcat container. The Gnu version is nice / unusual in that it lets you generate native executables.

• Do you need the full Java Development Kit which includes the compiler (if you're running JSPs on Tomcat, or developing code yourself, you do), or is just a Java Runtime Environment - the java engine plus all the standard classes that almost all code uses - sufficient? You can also download just a Java Virtual Machine - the core engine - but that's not much use without the supporting classes

• Micro edition (suitable for generating code to run on tiny devices), Standard Edition (a typical, middle of the road setup for client workstations), or Enterprise Edition (including all the server stuff). Surprisingly, for a simple Tomcat server setup, the Standard Edition is enough as the servlet-api which is in the enterprise edition is ALL you would need from the enterprise edition ... and it's included in the Tomcat distribution anyway.

• Download for the correct processor chip set. Although Java class files are portable, the underlying virtual machine is not - it's written in C and is compiled up for a particular processor

• Download for the correct operating system. As the code of the JVM is in C, and makes system calls, you need to have the version that's right for your operating system. If you download a Linux version and try and run it on Windows it won't work - even if you got everything else right - since the OS calls will be missing!

• And finally, you will need to download an appropriate release of Java. "Latest is best" may be your automatic reaction, but if you are compiling applets that will run in your user's browser, that may not be the case since you need to be able to generate class files that will be compatible with the JVMs that your users will have installed in their browsers. You can do yourself a huge dis-service by providing an applet that will ONLY work in the very latest browser releases because it uses new facilities that most people haven't yet upgraded to!


If you're installing Tomcat, you'll need to have Java installed - and you'll need the right version of Java to go with your Tomcat. Firstly - get the correct chip and OS version, and note that you'll want the Java Development Kit (JDK) and at least the standard edition of Java. Then choose your version.

• Tomcat 6 requires Java 1.6 (a.k.a Java 6). In the future, that will probably read "Java 6 or later".

• Tomcat 5.5 requires Java 1.5 (a.k.a. Java 5) or later

• Tomcat 5.0 requires Java 1.4 (a.k.a. Java 2 1.4) or later

If you must use Tomcat 5.5 with Java 1.4, there's an extra download available that will let you patch your Java and run that combination ... but Java 1.4 is getting old and the need for that patch is fading fast.