How to handle Java 5 code in CTF tests .... add a flag to the TestDescriptor.xml to indicate that this entire test case is Java-5 only. It has to be all-or-nothing. You cannot have a TestDescriptor.xml with one unit test that is Java 1.3 and another that is Java 5, because all of the code for a CTF test is either compiled or not. Buf if a full TestDescriptor.xml is Java 5 and all of the tests in that directory are Java 5, then that whole test can be disabled for those running under Java 1.4 and earlier.
That will avoid trying to compile Java 5 source under an earlier compiler.
I cannot see an easy (or reasonable) way to have one TestDescriptor.xml with two different unit tests where one unit test is Java 5 and the other is Java 1.4.