Christoph Wagner wrote:
Am 05.07.2010 21:01, schrieb Petr Nejedlý:
Christoph Wagner wrote:
Is there no way to load the additional jars with josm?
Isn't the URLClassLoader respecting Class-Path: attribute from the
manifest?
You should be able to keep the library in a separate jar and reference
it only
from your plugin's manifest...


No exactly that is not the way it works because the standard classloader 
doesn't know how to handle jar files in jars.
Look here:
http://one-jar.sourceforge.net/
But I'm not talking about putting the library jar into the plugin jar, but rather about distributing 2 files, a plugin and a library. If JOSM can't handle downloading additional files (like the library) along the plugins' jar file, it might work to unpack the library during the first start to a predefined (relative) location. At worst, it will work with a JOSM restart.

If you don't like this idea, you may end up implementing/using something like JarClassLoader from inside your plugin. Your plugin will still be loaded by the URLClassLoader and won't "see" the library classes directly, but if I understand it correctly, you only need to convince the JDK core that there is an additional service provider, and the APIs are inside JDK. Then you may be fine with loading the service implementation by passing your JarClassLoader to the service loader...
I need another possibility. One-jar uses the jarclassloader which is able to 
handle jars in jars. But onejar produces a single executable jar with a 
Mainclass included.
Not really usable for a josm plugin.

Christoph

------------------------------------------------------------------------

_______________________________________________
josm-dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/josm-dev


_______________________________________________
josm-dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/josm-dev

Reply via email to