| Java 5 and Eclipse
3.1M4 CIT 594, Spring 2005 |
jdk-1_5_0-windows-i586-1.exe.docs/index.html (Sun's
recommendation) or to docs/api/index.html (my recommendation).Note: Eclipse 3.1M1 is the first version to support any Java 5 features; the current build, 3.1M4, supports most of the Java 5 features. Some experimentation may be needed to find out what to avoid. Eclipse 3.1 does not appear to be as stable as 3.0 (I've had it crash), but we need 3.1 so we can use Java generics.
workspace, which contains the programs you wrote!j2re1.4.2_06 (or similar)
to jre1.5.0.C:\Program
Files\Java\j2re1.4.2_06 (or similar) to wherever you put the JRE;
mine is at C:\Program Files\Java\jre1.5.0.file:/C:/Program Files/Java/docs/api/.
public class JustTestingJava5 {
enum Season { SUMMER, FALL, WINTER, SPRING }
public static void main(String[] args) {
for (Season s : Season.values()) {
System.out.println(s);
}
}
}
|
Apple will bundle Java 5 with its next operating system release ("Tiger," Mac OS X 10.4), but has not yet specified a release date. There is some reason to believe that it will become available during the Macworld Conference & Expo, January 10-14, but other reasons to believe that it will be available March 24.
An expensive alternative is to go to Apple Developer Connection and pay $500 to become an "ADC Select Member," which will allow you to get the "Tiger Early Start Kit for Developers." I do not recommend this option unless you have other reasons of your own to join ADC.
Since Java 5 isn't yet available, it's not clear that there's any point to
getting a newer version of Eclipse. However, if you want to, you can go to any
of the sites as described above and download eclipse-SDK-3.1M4-macosx-carbon.tar.gz.
Unpack these files (typically this will happen automatically) and put them in
some convenient location.
Eclipse can be set to compile Java 5 code, but since you don't have Java 5,
there isn't much point to doing so. Go to Window > Properties >
Java Compiler > Configure Workspace Settings... and set the three
pulldowns to 1.4.