In order to use any Java lib in ThingWorx, you need to create an Extension, in Eclipse.
If you look in the Wiki, section 09. ThingWorx Extensibility has the documentation you need (description + sample Eclipse Java project).
As a side note, creating an Extension for ThingWorx, most of the time, means just wrapping the existing functionality from your JARs.
After some time spent familiarizing yourself with the Object Model of the Extensions (very similar with the TW one) you will see that creating an Extension is very easy, doable in 1-3 days.