Java Code for Multiple JDK Versions
Java 1.4 brought changes to a few core classes that can get in the way if your code needs to compile on both the older JDK 1.3 and the newer JDK 1.4.
The first article shows how to adapt your code to both JDKs using reflection and the Strategy pattern, and how to use Ant to import the right package. A JDK 1.3 build gets only the imports for that platform, and a 1.4 build gets a different set.
The second article explains what the -target and -bootclasspath compiler flags do and how to use them to compile with different JDK versions.
- (26 September 2003, JavaWorld) Overcome J2SE 1.3–1.4 incompatibilities
- (23 May 2003, JavaWorld) Write and compile code targeting different Java versions
Related articles
Related CZ Podcast episodes
- #3 · Java 6 SE, Vývoj webových aplikací
Dagi and Filemon discuss Java 6 and web application frameworks. · Czech audio
- #1 · Vývojová prostředí v Javě
The first CZ Podcast episode looks at Java development environments. · Czech audio