# Include Java or binaries in Extensions2.0

**URL:** <https://community.dynatrace.com/t/include-java-or-binaries-in-extensions2-0/48016>\
**Category:** Extensions\
**Tags:** databases, extensions\
**Created:** [September 27, 2024, 10:59am UTC](https://community.dynatrace.com/t/include-java-or-binaries-in-extensions2-0/48016 "2024-09-27T10:59:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TorstenHellwig](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/torstenhellwig/32/33996_2.png) [@TorstenHellwig](https://community.dynatrace.com/u/TorstenHellwig)\
**Post date:** [September 27, 2024, 10:59am UTC](https://community.dynatrace.com/t/include-java-or-binaries-in-extensions2-0/48016/1 "2024-09-27T10:59:00Z")

</div>

Hi all,

I’m converting an EF1 extension to EF2 that is similar to the old SQL-Extension. Since it talks to a DB2 on z/OS there is no pure Python driver available so I’m using Java. I’m able to include a jar-File in the extension folder so it get’s zipped up with the build command.

But it’s not deployed anywhere on the target active gate.

How do I do this? Also asking in case I want to include anything non-Python.

best,

Torsten

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [September 27, 2024, 12:00pm UTC](https://community.dynatrace.com/t/include-java-or-binaries-in-extensions2-0/48016/2 "2024-09-27T12:00:18Z")

</div>

Did you try to configure this in the setup.py in the package\_data? We include external native libraries with this approach, so I expect this will work with the JAR files too.

---

<div class="post-metadata">

**Author:** ![Mike\_L](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mike_l/32/11717_2.png) [@Mike\_L](https://community.dynatrace.com/u/Mike_L)\
**Post date:** [September 27, 2024, 12:15pm UTC](https://community.dynatrace.com/t/include-java-or-binaries-in-extensions2-0/48016/3 "2024-09-27T12:15:41Z")

</div>

This is the example from the IBM MQ extension, which includes a jar:

```markup
setup(name='ibm_mq',
      version=find_version(),
      description='IBM MQ EF 2.0 extension',
      author='Dynatrace',
      packages=find_packages(),
      package_data={"ibm_mq": ["pymqi/*", "lib/*", "shared/*"]},
      python_requires='>=3.10',
      include_package_data=True,
      install_requires=['dt-extensions-sdk', 'requests', 'charset-normalizer<3.0.0', 'defusedxml', 'urllib3', 'psutil'],
      extras_require={"dev": ['dt-cli','pyyaml']},
      )

```

---

<div class="post-metadata">

**Author:** ![TorstenHellwig](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/torstenhellwig/32/33996_2.png) [@TorstenHellwig](https://community.dynatrace.com/u/TorstenHellwig)\
**Post date:** [September 27, 2024, 12:54pm UTC](https://community.dynatrace.com/t/include-java-or-binaries-in-extensions2-0/48016/4 "2024-09-27T12:54:27Z")

</div>

That looks good! You should really publish the full possibilities of the EF2 framework (json schemas and everything) ;-)!

Thanks Michael!

---

<div class="post-metadata">

**Author:** ![david\_lopes](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/david_lopes/32/27273_2.png) [@david\_lopes](https://community.dynatrace.com/u/david_lopes)\
**Post date:** [September 27, 2024, 2:41pm UTC](https://community.dynatrace.com/t/include-java-or-binaries-in-extensions2-0/48016/5 "2024-09-27T14:41:46Z")

</div>

I agree with the schema, but “full possibilities” is quite a lot.

Remember that an extension is just a python module, anything you can do with the python setup.py file and in python can be done, like adding static files, that is documented [here](https://setuptools.pypa.io/en/latest/userguide/datafiles.html) for instance and it is not a Dynatrace Extension specific feature

We can’t recreate the entire python and setuptools documentation in Dynatrace

---

<div class="post-metadata">

**Author:** ![TorstenHellwig](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/torstenhellwig/32/33996_2.png) [@TorstenHellwig](https://community.dynatrace.com/u/TorstenHellwig)\
**Post date:** [September 27, 2024, 3:30pm UTC](https://community.dynatrace.com/t/include-java-or-binaries-in-extensions2-0/48016/6 "2024-09-27T15:30:15Z")

</div>

Hi David,

you’re right - I wasn’t aware that setup-tools is used. Never worked with larger Python projects.

Without looking at the ibm mq extension however I would have had no chance to find my files afterwards…

Now it’s working great, finds the java executable and everything.

I like!

Have a nice weekend!
