-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find a way to use Reach/Eidos jars simultaneously #394
Comments
I think you can use separate explicit class loaders in Java to manage this, rather than using the default class loader. https://stackoverflow.com/a/6108133 |
That stackoverflow suggestion is good but that piece of code would have to be integrated into pyjnius to work (since pyjnius is the one that actually ends up loading a class you specify). I'll have to dig into it a bit more. |
The issue is that as soon as |
If all you want is to add JARs to the classpath of a running Java, apparently that is possible; see kivy/pyjnius#434 (comment). Not sure if changes would be needed on the pyjnius side, though. |
Thanks, @ctrueden, I guess the issue is that I would need to both add and remove paths from the CLASSPATH during runtime (see kivy/pyjnius#411 (comment)) to solve this issue. |
@bgyori Ah, yeah, in that case you'd need to use custom class loaders on the Java side. And you can't wrap those dynamically loaded classes on the Python side (see kivy/pyjnius#316); if you try you'll see something like:
But you can work with dynamically loaded classes on the Java side... as long as they don't leak to Python as return values or whatnot. If you're looking for an easy way to dynamically load classpath elements, you could check out the Groovy scripting language and its |
Currently the fat jars for Reach and Eidos can't simultaneously be on the CLASSPATH because they pack conflicting dependencies that lead to errors. This has prevented me from adding tests for Eidos without breaking Travis builds. A solution would be to introduce REACHPATH and EIDOSPATH variables that are added to the CLASSPATH from within the respective APIs to make sure the right one is on the CLASSPATH at the right time.
The text was updated successfully, but these errors were encountered: