Eclipse SDK and Java 5

Every now and then, somebody asks a question about whether or not the Eclipse IDE supports Java 5. If you look at the 3.1.2 release notes, you’ll see that version 3.1.2 has been tested on Java 1.4.2 on variety of platforms (Linux, Windows, Mac OS, AIX, Solaris, HP-UX) as well as Java 5 on Windows XP. Based on this information, one might conclude that Eclipse 3.1.2 only supports Java 1.4.2.

When the release notes talk about the tested platforms, they are referring to the platforms upon which the Eclipse IDE itself runs. That is, the Eclipse IDE is itself a Java program that runs on a Java virtual machine (JVM). The Eclipse IDE, version 3.1.2, including the views, editors, compilers, and what-not are all tested and validated on the Java 1.4.2 JVM (and Java 5 on Windows XP). While the 3.1.2 plan doesn’t specifically discuss running on Java 5, many people are doing just that. In fact, if you take a look on news.eclipse.org/eclipse.platform, you’ll find several messages from folks who have been successfully running an Eclipse 3.1 version (including pre-release versions) on Java 5. It works (I’ve been running 3.1.1 on Java 5 on both Windows and Linux for months). So… while it’s not officially tested in the lab, it is certainly tested in the field.

That aside, the Eclipse SDK 3.1.2 does support the construction of applications using Java 5. You can build, edit, compile, debug, and test Java 5 projects with all the bells and whistles you’ve come to expect from Eclipse (you can, for example use code completion to fill in the type for a generic).

Out of the box, Eclipse 3.1.2 is configured for creating Java 1.4 applications. You can turn on Java 5 support using the preferences window as shown below.


If you set the “Compiler compliance level” to 5.0, it’ll let you use all the wonderful new syntax introduced with Java 5. If you’re not running Eclipse itself on a Java 5 JVM, you’ll have to add one to the “Installed JREs” in order to gain access to the Java 5 libraries and source code (look here for help). You can also specify what version of Java you want to work on a project-by-project basis. You can have some projects in your workspace that use Java 1.4 and some that use Java 5 (and some that use other Java versions).

Eclipse 3.2 is tested against Java 5 on all platforms; it says so right in the plan. Version 3.2 doesn’t officially ship until June (as part of the “Callisto” release train), but you can get it today so long as you don’t mind running into an occasional bug (as should be expected when using a pre-release build). If you do run into a bug, be sure to report it so that development teams can address the issue. I’ve been working with Eclipse 3.2M3 for a few months now and it’s been great.

So… does Eclipse support Java 5? It sure does. In summary:

  • Eclipse 3.1.x is tested and validated on Java 1.4.2
  • Though not officially tested and validated, Eclipse 3.1.x is run on Java 5 by many people who use it every day for development
  • Eclipse 3.2 is tested and validated on Java 5
  • Both Eclipse 3.1.x and 3.2 can be used to build, compile, debug, and test Java 5 applications
This entry was posted in Uncategorized. Bookmark the permalink.

3 Responses to Eclipse SDK and Java 5

  1. Doug Schaefer says:

    The bigger question is will the Eclipse SDK 3.2 run on Java 1.4.

  2. Wayne says:

    I don’t know if it’s a bigger question, but it sure is a big one. My take is no based on the wording in the plan.Some features planned for the SDK (such as Annotation Processing support) require Java SE 5, and as such the 3.2 release of the Eclipse SDK as a whole is developed against version 1.5 of the Java Platform (i.e., Java SE 5).Anybody else have a different take?

  3. Ed Burnette says:

    Last I heard Eclipse 3.2 still only required the Java 1.4 level. There are a few plug-ins such as Mylar that require the 1.5 level but they are the exception. In fact many of the core parts of Eclipse will work on lower/subset versions of Java.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s