
Java: not your cup of tea?
It has come to my attention recently that there is some confusion (even among quite knowledgeable technical people) about the correct usage of Java terms like JDK, JVM, etc. I think this springs from the fact that a lot of developers use them interchangeably, assuming that the other person will understand the meaning from the context. Some of the acronyms are even used commonly by developers in places where they don't even make sense.
I thought I'd make a public service blog defining some of these terms as I've seen and heard them used, to help others who might need this information for their work.
Who should read this? People who are not Java developers: marketing and sales people, technical writers, support staff, others without a lot of Java experience. This post intentionally skips over many technical details.
The Java Virtual Machine (JVM) is the piece of software that runs a Java application. All Java software runs "in" or "on" a JVM. All JVMs provide the same environment for your application to run in, which allows a Java application to run on Windows, Linux, Mac and many other platforms.
Sun develops the most popular JVM implementation and provides it for Windows, Linux and Solaris. The JVM for Mac OS X is developed by Apple. BEA and IBM have implementations of the JVM, and there are a few minor open source ones. Although it's not used often, the term Java Runtime Environment (JRE) means an implementation of the JVM and all the other stuff you need to run a Java application. You might hear people say "the Sun JRE" or "the BEA JRockit JRE" in reference to this.
Before we go much further, I should explain a bit more about how application programming interfaces (APIs) work and the word "implementation" actually means. API is a very vague term and basically means "someone else's code you run to do stuff". Because you might want to do the same stuff in different places (like on Windows and Mac), most APIs just standardise the way you ask for something to be done. An implementation of that API actually has the code that is executed when you ask for it to happen. This is how Java APIs work. There is a diagram on the right that shows this graphically.

How APIs work
As I mentioned above, it is because each JVM provides the same environment that Java applications can be run on different platforms. This environment is called the Java Platform, Standard Edition (Java SE), or informally, the JDK. It consists of a framework of about 3700 classes. These classes must be implemented according to this specification in every JDK. Sun defines this specification.
The Java Platform, or JDK, has evolved over time so there are several versions of it. The latest major version is Java SE 6 or JDK 6. Our applications are mostly written against either version 1.4 or 5, which are both still supported by Sun.
Even though the Java Platform is often called the JDK, the correct definition is very different. As originally defined, the Java Development Kit (JDK) is actually a combination of Java compilation tools and API implementation for a particular version of the Java Platform. It also typically includes a Java runtime (JRE), so that you can run the programs you compile.
It is in the usage of the term "JDK" that most of the confusion arises. For reasons I don't understand, it has become commonplace to hear the version of the platform one is running referred to as one's JDK. You can say "download the Sun JDK" to mean download the Sun Java compiler and associated tools, but it's also common to hear "Confluence requires JDK 5" which is about what version of the Java API that Confluence uses, not specifically related to the compiler itself. While the latter form is in common use, it would be better to say "Confluence requires Java 5", which is commonly used and also technically correct.
Java Enterprise Edition (JEE), formerly Java 2 Enterprise Edition or J2EE, is a collection of APIs which aren't included in the standard JDK but provide functionality which is useful for many server applications. One example is JavaMail, which is a standard way of accessing email from Java. This isn't available with the standard JDK, but Sun has provided a standard API and implementation for people to use in Java applications.
Application servers provide implementations of many of the JEE standards. Most important to Atlassian applications are the Java Servlet API, the Java Transaction API and the data source APIs in JEE. We also rely quite heavily on a front-end technology called JavaServer Pages (JSP). People talk about "JEE application servers" or just "application servers". You don't often hear JEE or J2EE mentioned when talking about versions or application requirements, except in the most technical discussions.
Because these terms can be used either correctly, informally or incorrectly, I've split the examples into three sections.
Of course, there are many ways to mash the terms together so they don't make sense at all. I'm sure I don't need to provide any examples of that.
Some notes for the narky developers out there who will argue with my definitions on the basis of minor technical concerns. I have intentionally omitted the following details:
Thanks to the Atlassian developers who pointed out several edge cases I had missed, and to Chris Owen for reviewing an early draft. Please feel free to post any questions or criticisms in the comments.
Cheers!
I’ve heard quite a few people refer to Java EE as ‘JEE’ since the name change from J2EE. For example, this article on InfoQ:
http://www.infoq.com/news/2008/04/compare-jee-2
The Spring guys here in Sydney were talking about their new JEE server when it was announced. There are plenty of other examples if you search for JEE application server on Google.
However, I’d probably tend to use Java EE, as you say. JEE seems awkward to say, and I’d also hate to hear it pronounced like the word ‘gee’.
It’s just a perfectionist’s comment :P
http://weblogs.java.net/blog/kgh/archive/2005/06/goodbye_j2se_he_1.html
and additionally:
http://weblogs.java.net/blog/kgh/archive/2005/06/goodbye_j2se_he_1.html
Comments on this article have been closed.