how do you load the plugins into the application

how do you load the jar-files(plugins) in the application without including in the sourcepath???

4 comments

Just place the plugin jar in the plugins directory of IntelliJ. If IntelliJ is running, you will have to restart IntelliJ for it to see the new plugin. Is this what you wanted to know?

Tobin

0

no, i want to know how you can do this in java-code

0

Michael Seele wrote:

no, i want to know how you can do this in java-code


I suppose they're doing something approximately like this (from memory
-- I might not get every detail right):

URL path = new URL("file://ideaDirectory/plugins");
URL[] paths = new URL[] ;
ClassLoader cl = new URLClassLoader(paths);
Class c = cl.findClass("com.foo.MyPlugin");
Plugin pl = (Plugin) c.newInstance();
pl.whatever();

0

Please sign in to leave a comment.