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???

0

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
Avatar
Permanently deleted user

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

0
Avatar
Permanently deleted user

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
Avatar
Permanently deleted user

thanks. that works!!!

0

请先登录再写评论。