Testing a new jar and how to use it locally


I did manage to get a compiled jar using the developer instructions.
What I did miss and could not find is how to publish it in what folder to actually use it is my local Openhab environment.

I found the /srv/openhab-system/addon folder and placed the. Jar in this folder. But I cannot use it, it seems the kar (library of add ons?) is used as primary source.

Any guidance appreciated…. Python is my software base, Java is completely new so bare with me :wink:

Most of the time it is as simple as.

  1. UNINSTALL the binding if you have it installed.
  2. Drop the jar into the addons folder.

Drag and drop without needing a reboot! openHAB is very cool in this area.

I’m guessing you have not done step 1 and it is still using the merged binding. It does not matter which order you do the two steps in. You do not need to re-add your things and items, everything should just come back normally when openHAB starts up the addons jar or the merged one when you switch back.

The only time it has not worked for me is when you have dependencies that you have to deal with as the merged jars get handled differently in this area, so it is important to read the logs if it does not work right away. Also, it will not show up in the list of installed bindings, so a way to check is to try and add a thing from the inbox and the binding will show up in there.

Thanks for the tips! I try it out his evening.
The original jar / add-on is part of the Karaf container and that is still visible even after an uninstall.
OK so the new JAR not be shown as a separate add-on but “available” anyway. That makes sense.

A JAR and a KAR are just zipped files with the extension renamed, so you can open them with a zip program to see the files inside. If you have a KAR in the addons, you will need to remove the whole file, or you could manually delete the binding from inside it so the rest of the KAR gets seen and is useable. I have never tried to put two of the same binding into the addons folder, so I am guessing that is what you’re doing.

1 Like

Indeed, the add-on (the one for the Envoy binding) is temporary replaced by a new version until officially published (when approved).

So unzip, delete the original add-on. Add a separate JAR and voila! I test this evening: thanks so much for clarification. Nice setup and I like the modular approach

I would not recommend updating the kar file in the addons folder. It should be enough to just drop the jar file in the addons directory. In that case the original addon in the kar file would still be visible in the list of bindings to install, but the jar file placed in the addons directory should automatically be installed (without reboot). However you won’t see the binding in the installed binding list in the UI. But when you go to things in the ui you should be able to add a new thing (click on the +, and the binding should be listed).

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.