I'm building an application, and I'm thinking long-term I would like to be able to allow plugin support. The application I'm creating is a Java based application. How could I allow plugins using a scripting language, or is it better to require plugins to use Java?

Would I need to create some sort of plugin interface to allow the use of plugins?

Any ideas of references of where to start?

closed as too broad by user40980, GlenH7, Ampt, gnat, jwenting Jun 17 '14 at 8:20

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


If you ask me, plugins using Java is better as it is relatively easier than scripting languages. You have to provide some sort of interface to the plugins. After you successfully implemented the plugin architecture, it is also useful for yourself to implement extra-functionality to your application, without breaking the existing code. See how NetBeans or Eclipse works. Those softwares load a number of files in the name of "packages" during start-up. Those packages are actually a kind of plugins. Alternatively, implementing a successful plugin architecture require quite some effort and costs performance (see the load times of Eclipse).

https://stackoverflow.com/questions/465099/best-way-to-build-a-plugin-system-with-java http://www.javaranch.com/journal/200607/Plugins.html

  • 1
    Thank you, that's basically the answer I was looking for. – RyanDawkins Jun 14 '14 at 4:11

If you, or others with similar skills will be writing the plugins, then why not stay with the host language? If your application addresses a particular (non-software) area of expertise, and you want to give end-users the ability to write their own plugins, then a custom scripting language, well suited to expressing solutions in the end-users' domain of expertise, could make the plugin interface more accessible to them.

In your design you'll need to consider what parts of your application you want to expose to the plugin interface, and how to limit the potential damage from a badly written plugin. Those answers will guide you to the design of the interface.

Not the answer you're looking for? Browse other questions tagged or ask your own question.