Importing JAR files

I have searched the forum and have an idea on how to include third party Python libs, but what about third party JAR files?

For example I want to use Jyson library to work with JSON. Where would I place this JAR file?

Thanks

There’s two ways.

The first is easiest, but not supported or endorsed by us: you to simply drop the jar into the lib/core/gateway, lib/core/client, or lib/core/common depending on the scopes you need access to it in.

The second has much more overhead, but is the way our design services team does it as well: create a module using the Ignition SDK and expose your own scripting functions to make use of one or more 3rd party libraries.

Sorry to bring this from the dead but the only way that works for me is by using sys.path.append(jar). Is there any way to actually reference the jars after they are distributed to the client?

edit: well I put the jar into pylibs since I have a reference to that folder

I think the requirements have changed a little: Adding java custom classes to Ignition

Ah yes, that makes sense.

This first way doesn't seem to work for me. I restarted the designer but not gateway server, I will try to restart gateway as well and see.

If I have to access it from client as well as gateway then i will have to create two modules in client and gateway scope I guess. However the gateway module can simply startup and use a few of the libraries and shutdown. Is it OK or it has to remain in memory?