|How to dynamically add to a plugin's classpath? [message #635513]
||Wed, 27 October 2010 07:35
Registered: October 2010
I need help with wiritng an Eclipse plugin. I've made a parser that scans .class files, takes annotations out of them and puts them all into an XML file. It's a Java application, with a (basic) GUI. This works if I add the application to an existing Eclipse project - the parser successfully scans all folders, finds all .class files and makes XMLs if needed.
However, I now have to convert it into an Eclipse plugin. I've managed to add the button with the appropriate action command which launches the parser. The parser does find all .class files for the project that is selected in Package Explorer, but ClassLoader always throws a classNotFound exception. I've tried using ClassUtils to get the class, setting "true" to initialize them, but that didn't work.
Basically, I think the problem is that my Eclipse plugin doesn't see classes of Eclipse projects, because they are not in its classpath. Is this correct? How can I do this? Can I take a project's classpath (how?) and dynamically add it to plugin's classpath? Would that work? If not, how can I do this? Can it be done at all?
Thanks in advance.
Powered by FUDForum
. Page generated in 0.02263 seconds