dagblog.
← Archive

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.

Medium version

Related articles

Related CZ Podcast episodes