|
Sweet Home 3D Forum » List all forums » » Forum: Developers » » » Thread: How to load "foreign" jars from a Plugin? » » » » Post: Re: How to load "foreign" jars from a Plugin? |
Print at Dec 20, 2025, 5:31:36 AM |
| Posted by Puybaret at Mar 3, 2015, 10:18:09 AM |
|
Re: How to load "foreign" jars from a Plugin? I would do it first "by hand" with a zip utility, i.e. once you compiled the classes of your plug-in and generated a jar file from them with Eclipse, open the jar file with a zip utility and add to it the content of json-simple-1.1.1.jar, simple.jar and ST-4.0.8.jar. I've already done that in the past for some plug-ins, to include SunFlow classes or even JMF library. Once it works, I think it should be time to learn Ant basics to automate compilation and plug-in generation. Ant is some kind of make but much simpler and nevertheless powerful. All Sweet Home 3D files I release are generated with Ant that you can even launch from Eclipse. With 1189 lines, the Ant build.xml file of Sweet Home 3D is probably not the easiest way to understand how Ant works, but compiling, creating a jar file and merging jar files is something you can do in just a few lines. we don't want duplicate code loaded. I'm not sure jars should be in a jar. You should include classes only in the final jar. Including jars would require a special class loader to extract them and it's a needless tedious task.If another Plugin happened to use the same jar, you'd want the JVM to share. The jar files you want to include are small and you shouldn't worry about that. Hope you can make it... ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
|
|
Current timezone is GMT Dec 20, 2025, 5:31:36 AM |