# What's the best way to handle multiple libraries using the same imports

**URL:** https://discourse.processing.org/t/whats-the-best-way-to-handle-multiple-libraries-using-the-same-imports/20577
**Category:** Processing
**Created:** [May 7, 2020, 5:47am UTC](https://discourse.processing.org/t/whats-the-best-way-to-handle-multiple-libraries-using-the-same-imports/20577 "2020-05-07T05:47:52Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [May 12, 2020, 5:44pm UTC](https://discourse.processing.org/t/whats-the-best-way-to-handle-multiple-libraries-using-the-same-imports/20577/2 "2020-05-12T17:44:04Z")

</div>

I believe that this is here:

> <https://github.com/processing/processing/blob/8e86389c7e017d0e4d61f81fb942c25e3ed348c7/app/src/processing/app/Mode.java#L405-L412>

cross-linking:

> <https://github.com/processing/processing-library-template/issues/29>
>
> It seems inside the Processing editor (PDE) one can use a single library that us…es an underlying java library. Here’s an example:
> 
> !\[multiple import \](https://aws1.discourse-cdn.com/standard10/uploads/processingfoundation1/original/2X/4/4cb1aa541c10a069082b75e44fe7b3e48e2702f8.jpeg)
> 
> One workaround would be for one of these Processing libraries to use the JBox2D underlying java library and the other two Processing libraries to use the first as a dependency, however coordinating something like this sounds unlikely.
> 
> What would be the elegant solution ?
> 
> Thank you so much,
> George
> 
> P.S. I've posted the same question on the \[Processing forum\](https://discourse.processing.org/t/whats-the-best-way-to-handle-multiple-libraries-using-the-same-imports/20577)

The issue is not just that they are using the same underlying library – it is also that they _might_ be using different versions of that library.

Previous discussions:

- [boxwrap2d VS Pbox2d - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/577/boxwrap2d-vs-pbox2d)
- [How to deploy library that requires Processing's Serial class - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/1040/how-to-deploy-library-that-requires-processing-s-serial-class)

> [@George](#):
>
> one of these Processing libraries to use the JBox2D underlying java library and the other two Processing libraries to use the first as a dependency, however coordinating something like this sounds unlikely.

One approach would be to create a fork of any or all of them, Box2DThin, FisicaThin, LiquidFunThin that are all built with JBox2D imported, e.g.

```auto
classpath.local.include=jbox2d.jar

```

Then you can mix installing any number of Thins plus one original, or all the Thins plus just the jbox2D.jar… assuming they are using the same. So the Thins would be available as a workaround option for exactly this issue.

Another approach would be creating something like “MultiBox2D” – a composite fork that bundles Box2D, Fisica, and LiquidFun along with JBox2D as a shared external dependency to all three… and anything else you want to throw in there. Anyone who wants any of them installed simultaneously could then use that one library, which installs them all.

---

_[View the full topic](https://discourse.processing.org/t/whats-the-best-way-to-handle-multiple-libraries-using-the-same-imports/20577)._
