Libraries vs Frameworks vs APIs
APIs are different, in that they interface directly with either a browser or with the operating system. Java is an example of an application programming interface (API). It has libraries, but the actual code takes place in the class you are programming in; only the objects are inherited. All the properties have to be defined.
To explain how this differs from a framework, a JQuery library function is executed at runtime only when it is called. A framework typically runs all the time and your programming is called from it rather than your program calling a function from a library.
Size of JQuery java libraries