Java build fixes