# Amending existing binding code - what is the "right" way to install it?

**URL:** <https://community.openhab.org/t/amending-existing-binding-code-what-is-the-right-way-to-install-it/145930>\
**Category:** Add-ons\
**Created:** [April 9, 2023, 11:11am UTC](https://community.openhab.org/t/amending-existing-binding-code-what-is-the-right-way-to-install-it/145930 "2023-04-09T11:11:10Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![PrzemoF](https://community.openhab.org/letter_avatar_proxy/v4/letter/p/41988e/32.png) [@PrzemoF](https://community.openhab.org/u/PrzemoF)\
**Post date:** [August 1, 2023, 7:30pm UTC](https://community.openhab.org/t/amending-existing-binding-code-what-is-the-right-way-to-install-it/145930/7 "2023-08-01T19:30:15Z")

</div>

For future use:  
My setup: a laptop for coding & compiling, rpi running openHUB.

1. git clone [GitHub - openhab/openhab-addons: Add-ons for openHAB](https://github.com/openhab/openhab-addons.git)
2. find the binding to work on, in my case it’s in openhab-addons/bundles/org.openhab.binding.denonmarantz
3. compile the binding without any code changes to make sure the compilation works OK

```auto
mvn clean install -pl :org.openhab.binding.denonmarantz

```

1. On compiling errors first check java --version and mvn --version and make sure it’s all OK with the versions
2. Make changes or apply patches
3. Compile again
4. Successful compilation producer jar file in the target directory. In my case in openhab-addons/bundles/org.openhab.binding.denonmarantz/target and the file is called org.openhab.binding.denonmarantz-4.1.0-SNAPSHOT.jar
5. Transfer the file to the hardware running openhab to /usr/share/openhab/addons/ (on raspbian)  
9 Change the ownership of the file with

```auto
sudo chown openhab:openhab org.openhab.binding.denonmarantz-4.1.0-SNAPSHOT.jar

```

1. log in openHAB console with `ssh -p 8101 openhab@localhost`
2. search for the binding:

```auto
openhab> la -s|grep -i denonmarantz
237 │ Active │ 80 │ 4.0.1 │ org.openhab.binding.denonmarantz
245 │ Active │ 80 │ 4.1.0.202308011911 │ org.openhab.binding.denonmarantz

```

1. check the files (one is the original one, one is modified):

```auto
openhab> la -l|grep -i denonmarantz
237 │ Active │ 80 │ 4.0.1 │ mvn:org.openhab.addons.bundles/org.openhab.binding.denonmarantz/4.0.1
245 │ Active │ 80 │ 4.1.0.202308011911 │ file:/usr/share/openhab/addons/org.openhab.binding.denonmarantz-4.1.0-SNAPSHOT.jar

```

13 Uninstall the original binding and check it’s removed:

```auto
openhab> uninstall 237
openhab> la -s|grep -i denonmarantz
245 │ Active │ 80 │ 4.1.0.202308011911 │ org.openhab.binding.denonmarantz
openhab> la -l|grep -i denonmarantz                                                                                                                                                           
245 │ Active │ 80 │ 4.1.0.202308011911 │ file:/usr/share/openhab/addons/org.openhab.binding.denonmarantz-4.1.0-SNAPSHOT.jar

```

1. I run update (looks like OH3 might behave in a different way than OH4:

```auto
update 245 file:/usr/share/openhab/addons/org.openhab.binding.denonmarantz-4.1.0-SNAPSHOT.jar

```

1. Enjoy!

---

_[View the full topic](https://community.openhab.org/t/amending-existing-binding-code-what-is-the-right-way-to-install-it/145930)._
