changed parts depending on Java7 and fixed build of jar file