# Basic Module to Import libraries

**URL:** <https://forum.inductiveautomation.com/t/basic-module-to-import-libraries/2494>\
**Category:** Module Development\
**Created:** [January 10, 2011, 6:38pm UTC](https://forum.inductiveautomation.com/t/basic-module-to-import-libraries/2494 "2011-01-10T18:38:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [January 10, 2011, 6:38pm UTC](https://forum.inductiveautomation.com/t/basic-module-to-import-libraries/2494/1 "2011-01-10T18:38:21Z")

</div>

I am trying to include a Java library in Ignition, and believe I need to create a custom module to do so. How would one create such a module so we can add our own libraries as we see fit?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [January 10, 2011, 7:16pm UTC](https://forum.inductiveautomation.com/t/basic-module-to-import-libraries/2494/2 "2011-01-10T19:16:49Z")

</div>

Well in some sense that’s exactly what a module is - adding your own libraries. To add external libraries (i.e. libraries that you didn’t write and compile yourself) it should simply be a matter of including those \*.jar files alongside your module’s jar files in the \*.modl file, and include them in your module descriptor.

What you do with those included libraries is of course a different matter, and that depends greatly on what the library is…

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [January 10, 2011, 9:44pm UTC](https://forum.inductiveautomation.com/t/basic-module-to-import-libraries/2494/3 "2011-01-10T21:44:21Z")

</div>

Well, I want to use the libraries inside of some app scripts. What would be the steps to accomplish this?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [January 11, 2011, 10:21pm UTC](https://forum.inductiveautomation.com/t/basic-module-to-import-libraries/2494/4 "2011-01-11T22:21:19Z")

</div>

At the most basic, you’d package up the jar(s) into a module, including the jar in whatever scopes you want to use it from. Usually this will be either DC (designer/client), G (gateway) or DCG (all 3).

I suppose you could do no other work and then use:

[tt]from com.example import SomeClass[/tt]

Or you could be a bit nicer and write your own scripting module and merge it in somewhere like [tt]system.mystuff.\*[/tt]

We probably should put together an example module that does this so you have a template to follow.

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [January 11, 2011, 10:25pm UTC](https://forum.inductiveautomation.com/t/basic-module-to-import-libraries/2494/5 "2011-01-11T22:25:04Z")

</div>

Sounds good, the template will be nice. I would like to add my own scripting functions. If I wanted to create a module with just libraries, would I just put all the libraries, with the appropriate ignition libraries in a zip and rename it to .modl?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [January 13, 2011, 10:30pm UTC](https://forum.inductiveautomation.com/t/basic-module-to-import-libraries/2494/6 "2011-01-13T22:30:42Z")

</div>

That, and put a properly-formatted [tt]module.xml[/tt] file in there next to the jar files that lists the scopes for each jar file.
