Add support for both java 6 and java 7