How to load classes from other plugins?


I am writing a plugin (lets call it Plugin_M) that should load specific classes from other additional plugins (that work as extensions to the plugin I am working on).

My plugin Plugin_M works, with "ServiceLoader.load"  it loads successfully all necessary classes that are inside the plugin zip file (i.e. I installed it using the "Install Plugin from Disk..." menu point.

However, now I have an "extension" plugin (Plugin_E) that I also installed using the "from disk" menu point. It contains a file "" in which a class of Plugin_E is described.

I want that this class of Plugin_E gets loaded by the Plugin_M when it uses "ServiceLoader.load(". Is that somehow possible?

The alternative I am thinking about is using "URLClassLoader" to load the extensions from a specified directory instead of registering them through the IDE plugin system.

Please sign in to leave a comment.