Turn optimisation on and assertions off for Java library.