Add my plugin to new Java project classpath [message #1689435] |
Mon, 23 March 2015 11:19  |
Eclipse User |
|
|
|
Hi,
I want to add my plugin jar file to a newly created Java project.
I am doing it with this code but I wonder if there is a better/cleaner way to do it. The path used seems to be likely to change once my plugin is updated, so any existing projects would be broken.
I thought maybe of adding a library variable and using something similar, so that the project references the library and will be correct if the path ever changes.
URL url = new URL("platform:/plugin/" + MyPlugin.PLUGIN_ID);
String path = FileLocator.toFileURL(url).getFile();
IClasspathEntry pluginEntry = JavaCore.newLibraryEntry(new Path(path), null, null);
Francisco
[Updated on: Thu, 26 March 2015 19:26] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.61304 seconds