You do not need to install JDK1.5, but you will need Java 5 rt.jar and specify it in the compiler bootclasspath:
javac -source 1.5 -target 1.5 -bootclasspath /path/to/jre5/lib/rt.jar
Otherwise, you will compile with Java6 rt.jar , which contains JDBC 4 interfaces, and then the compiler will complain about unimplemented methods. Using the already compiled JDBC 3.0 library will work fine under Java 6 to such an extent that the method added to JDBC 4 is called.
source share