The easiest way is to have adapters in your code (a package for every version you support).
If the versions of the library are compatible with older versions, you can compile against the newest versions (this is how JDBC drivers are done, that need to support JDBC versions 2, 3, and 4 with the same driver jar), but if they are not, you will have to compile these adapter packages separately (against their version of the library). The second way is safer, too.
You can then merge the binaries together. Your factory will make sure that only the correct code will run.
You would then have a factory that figures out which version of the library to use (either by probing it somehow, or have to user configure it explicitly), and instantiates the appropriate adapter.
Update: The above assumes that you want to produce a JAR file that can work with different versions of another JAR file, but that at run-time (in a given installation), there would be only one fixed version of the third-party library. If you need to support multiple versions of the same classes in the same JVM, then you really need to look at OSGi.