fix compilation for java 6 and static library