Access a Java Project's class files through a plugin [message #1067595] |
Tue, 09 July 2013 09:57  |
Eclipse User |
|
|
|
Hi,
I am trying to get access to the class files of a Java Project from a plugin. The idea is that the user writes some Java classes and eventually invokes a handler of my plugin (e.g., through a menu). Furthermore, the user created a config-file in the same project which contains the fully qualified names of some Java classes.
I can read the fully qualified names without any problem in my plugin, now what I would like to do is instantiate the given classes (present in the project) from within my plugin.
I tried using Class.forName() which happens (not much to my surprise). However, I can't seem to come up with working way.
Does anyone know if/how this is possible?
|
|
|
|
|
|
|
|
Re: Access a Java Project's class files through a plugin [message #1069825 is a reply to message #1069725] |
Tue, 16 July 2013 12:38  |
Eclipse User |
|
|
|
You should consider the implications of loading an unknown class file into a running Eclipse instance. The class can do things that will make Eclipse unstable or even crash. Any static initializers in the class will be run when it is loaded. Dependent classes will attempt to be loaded, bugs in the users code will be executed, etc. If the class can be edited in the running Eclipse instance, you also have the problem of unloading and reloading the class when it is changed. If you really need to deal with user created classes, you should think about launching a separate application instance to test them out.
|
|
|
Powered by
FUDForum. Page generated in 0.06129 seconds