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

I believe that this is here:

cross-linking:

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:

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.

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.

2 Likes