Fixed more issues related to java7's try-with-resources,
and updated ECJ version detection.