I have ran into an issue when programming a plugin that is dependent on another plugin. The plugin in question has 3 different versions, all of them are incomparable with each other. Instead of writing 3 separate plugins, I would like to know which .jar file exists, and import the correct one.

Note: The plugins in question are actively running on the server, and I have no clue what is running on which server.

Thanks for your help.

Recommended Answers

All 3 Replies

I would assume your main file could simply check the availabilty of the dependencies and instantiate the correct version as needed.

Import statements are fixed at compile time, but fully qualified class names are not. You can control concrete class references at run time.

I did not write the origional plugin, or any of it's versions.

Edit: As of when I last checked, there are over 35,000 copies of plugin "in the wild", and I have no controle of them at all.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.