If you find this topic of interest, you may find the following course to be useful:

Eclipse 3.1 is the first release with built-in support for JDK 1.5. Previous releases required manual installation a of patch called Cheetah. In Eclipse 3.1, there is no need to install any patches to support JDK 1.5.

There are three areas that are affected by your choice to use JDK 1.5.

  1. The JRE class library JAR files must be used from a JDK 1.5 distribution. If you have JDK 1.4 or older installed in the development machine and you are not careful, the project may be erroneously built using the JRE JAR files from a non JDK 1.5 distribution. This is extremely dangerous since in the production environment there may be only JDK 1.5 installed.
  2. The compiler must support the JDK 1.5 language syntax as well as produce 1.5 compatible byte code.
  3. The Java 1.5 JVM must be used during unit testing.

INSTALL JDK 1.5 AND ECLIPSE 3.1

Eclipse itself can be run using JDK 1.4 or older. It is recommended that you download and install JDK 1.5 (instead of 1.4). This JDK can be used to run Eclipse as well as develop and unit test the projects. Download JDK 1.5 from http://java.sun.com/javase/downloads/index_jdk5.jsp and install it.

Download Eclipse 3.1 from this link. Simply unzip the downloaded ZIP file to install Eclipse. Run Eclipse by launching eclipse.exe from the installation directory.

CONFIGURE ECLIPSE

Eclipse uses a built-in Java compiler. The compiler supports Java 1.3, 1.4 and 1.5. The level actually followed by the compiler depends on the project settings. You can configure the Java level per project or set it as a default at a global level.

Launch Eclipse. From the menu bar, select Window->Preferences. Select the Java->Compiler preference. Set the Compiler Compliance level to 5.0.

Click on OK to accept the changes. Click on Yes to do a full rebuild.

CREATE A JAVA PROJECT

From the menubar, select File->New->Project. Select Java Project and click on Next. Enter Test as the project name.

Note that system using the default compiler compliance level of JDK 1.5 (shown as 5.0). Click on Next. Click on the Libraries tab.

Note that system has selected the JRE available from JDK 1.5. Click on Finish.

TEST CONFIGURATION

We are now ready to develop code in JDK 1.5. In the new project, create a package called com.webage.jdk5. In that package, create a class called Test.

Add code shown in bold face below

import java.util.*;

public class Test {

public static void main(String[] args) {
ArrayList l = new ArrayList();

l.add(“Hello”);
l.add(“World”);

for (Object o : l) {
System.out.println(o);
}
}

 

Save changes (Control+S). You should not get any compilation errors.

From the menu bar, select Run->Run As->Java Application.

The code should execute fine. System should automatically pick the javaw.exe JVM from the JDK 1.5 installation directory as shown in the top border of the Console.

}