# Add .JAR for using classes in Jython scripts

**URL:** <https://forum.inductiveautomation.com/t/add-jar-for-using-classes-in-jython-scripts/12529>\
**Category:** 3rd Party Modules\
**Created:** [January 9, 2017, 10:37am UTC](https://forum.inductiveautomation.com/t/add-jar-for-using-classes-in-jython-scripts/12529 "2017-01-09T10:37:10Z")\
**Posts on this page:** 1\
**Showing post:** 34

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 2, 2022, 10:23pm UTC](https://forum.inductiveautomation.com/t/add-jar-for-using-classes-in-jython-scripts/12529/34 "2022-09-02T22:23:39Z")

</div>

You might find this topic helpful, particularly the public release of my `FieldClassBuilder`:

> [@Machine Learning in Ignition using MATLAB](https://forum.inductiveautomation.com/t/machine-learning-in-ignition-using-matlab/56053/4):
>
> So, showing the whole thing is not on the table. Sorry. But one utility class I wrote will help you through the trickiest part of it: [FieldClassBuilder.java](https://www.automation-pros.com/streamer/FieldClassBuilder.java) (Note the MIT License.) This builder will assemble any desired classes from anywhere in your module, including any dynamically loaded classes you might access, into a generated class with a public static final field for each supplied class. The output from build() is suitable for use with ScriptManager.addScriptModule() in your various …

Note that this permits controlled exposure of classes in your module's classloader (normal jar) to any desired `system.*` namespaces without having to manually construct them when you change jar versions. I use this to accept many different versions of an externally-installed OpenCV jar (due to licensing, it cannot be packaged in a module) but still expose (nearly) all of its member classes.

---

_[View the full topic](https://forum.inductiveautomation.com/t/add-jar-for-using-classes-in-jython-scripts/12529)._
