Hello all, first post here so please forgive me if I'm not posting in the right place. I'm also not an english native speaker :roll:
Anyway, I've got this little app where I need to support plugins; the objective here is that a programmer can implement an interface and simply add the class to the classpath, and the app will load it.
The way I'm currently doing is, right after starting, querying System.getProperty("java.class.path") and searching for all classes there that implement this interface I want:
The ClassFinder class can be found
here (please note that I'm not the author, and simply copied it from somewhere to my project's svn).
If I run the app from inside eclipse, everything works just fine - all the classes are found and can be used. If, however, I use
ant to pack them (they are packed in several different .jar files), nothing is returned.
One thing I noticed when debugging is that running inside eclipse java.class.path returns the current (correct) classpath; however, if I get java.class.path when packed, it returns only the name of the launched jar (f2s-main.jar, in this case). Shouldn't it return everything that is set in the MANIFEST.MF Class-Path attribute? I do think that is set correctly because I can use other classes from these packages in the code.