Don't use API that is not available in java 5.