
Java
An API is really no more than a set of method signatures and other information necessary to use a class or set of classes. The API is totally distinct from the implementation. For example, a number of vendors have implemented the servlet API, each in a different way. The API by itself has no implementation.
Library (being JAR Java library) is a unit of deployment of one, many or part of API.