Fix build of Java tests