from carboxylic acids or from esters, anhydrides, or halides thereof by reaction with ammonia or amines