Java 5.0 and 6 used to have poor support for compiling classes to target older versions of Java. It always supported the previous version, but often no more.
Even if you could compile for previous version, you had to be careful not to use functionality which did exist in the previous versions.