# Binding development - unresolved requirements

**URL:** <https://community.openhab.org/t/binding-development-unresolved-requirements/42897>\
**Category:** Bindings\
**Tags:** openhab2-addons, development\
**Created:** [March 31, 2018, 10:29pm UTC](https://community.openhab.org/t/binding-development-unresolved-requirements/42897 "2018-03-31T22:29:08Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mladams922](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/f6c823/32.png) [@mladams922](https://community.openhab.org/u/mladams922)\
**Post date:** [March 31, 2018, 10:29pm UTC](https://community.openhab.org/t/binding-development-unresolved-requirements/42897/1 "2018-03-31T22:29:08Z")

</div>

I’m working on developing a binding, mostly to learn how the system works and maybe learn how to implement some things and contribute to the community. So far I’ve been able to create the skeleton and get a binding that compiles to a .jar file. When I take the .jar file and put it in the addons folder of Openhab and restart eh system I get this error:

```
2018-03-28 15:31:15.751 [ERROR] [org.openhab.binding.insteonplmmatt] - FrameworkEvent ERROR - org.openhab.binding.insteonplmmatt
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.insteonplmmatt [228]
  Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
  Unresolved requirement: Import-Package: org.eclipse.smarthome.core.util

at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1599) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514) [?:?]
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]
2018-03-28 15:31:17.050 

```

I’ve been searching the forum and I’ve seen other people have had similar problems but I’m not understanding how to troubleshoot this issue. I’ve looked at the installed bundles and it looks like everything listed as “unresolved requirements” is listed as “Active” in the bundle list in my Openhab runtime. So I’m not sure what’s missing. If anyone can help me out I’d really appreciate it. I’ve been making good progress so far, this is the only place I’m really stuck.

Thanks!

---

<div class="post-metadata">

**Author:** ![mladams922](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/f6c823/32.png) [@mladams922](https://community.openhab.org/u/mladams922)\
**Post date:** [April 2, 2018, 12:38pm UTC](https://community.openhab.org/t/binding-development-unresolved-requirements/42897/2 "2018-04-02T12:38:13Z")

</div>

Anyone have any thoughts on what might be causing this?

---

<div class="post-metadata">

**Author:** ![mladams922](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/f6c823/32.png) [@mladams922](https://community.openhab.org/u/mladams922)\
**Post date:** [April 2, 2018, 6:35pm UTC](https://community.openhab.org/t/binding-development-unresolved-requirements/42897/3 "2018-04-02T18:35:14Z")

</div>

So I tried doing

```
sudo apt-get remove openhab2
sudo apt-get remove openhab2-addons

```

followed by

```
sudo apt-get install openhab2
sudo apt-get install openhab2-addons

```

Still getting the exact same error. Any thoughts from anyone who’s done development work before.  
I hate to bother @Kai but I feel like if I can get over this hurdle and I can move on and make some progress.

Thanks!

---

<div class="post-metadata">

**Author:** ![Kai](https://community.openhab.org/user_avatar/community.openhab.org/kai/32/116281_2.png) [@Kai](https://community.openhab.org/u/Kai)\
**Post date:** [April 2, 2018, 11:02pm UTC](https://community.openhab.org/t/binding-development-unresolved-requirements/42897/5 "2018-04-02T23:02:20Z")

</div>

Which apt repo are you using? Bindings that are compiled against the latest code base will require the “unstable” apt repo, i.e. an openHAB 2.3.0-SNAPSHOT installation (openHAB 2.2.0 won’t work with it).

---

<div class="post-metadata">

**Author:** ![matt1](https://community.openhab.org/user_avatar/community.openhab.org/matt1/32/19930_2.png) [@matt1](https://community.openhab.org/u/matt1)\
**Post date:** [April 3, 2018, 2:20am UTC](https://community.openhab.org/t/binding-development-unresolved-requirements/42897/6 "2018-04-03T02:20:29Z")

</div>

How are you creating the jar file? Can u list the steps that you used to create the jar file? Did u use eclipse and menu clicks or did you use maven?

---

<div class="post-metadata">

**Author:** ![splatch](https://community.openhab.org/user_avatar/community.openhab.org/splatch/32/33925_2.png) [@splatch](https://community.openhab.org/u/splatch)\
**Post date:** [April 3, 2018, 8:00am UTC](https://community.openhab.org/t/binding-development-unresolved-requirements/42897/7 "2018-04-03T08:00:36Z")

</div>

> [@mladams922](#):
>
> org.eclipse.jdt.annotation

This one is most likely annotation as it is related to Eclipse **J** ava **D** evelopment **T** ools. If I would guess - this would be @NotNull or another static code analysis annotation.  
Annotations which are not found in runtime are simply ignored. Since its marked as optional lack of it in runtime will not cause any troubles (as you do not initiate any class from this package).

Cheers,  
Lukasz

---

<div class="post-metadata">

**Author:** ![mladams922](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/f6c823/32.png) [@mladams922](https://community.openhab.org/u/mladams922)\
**Post date:** [April 3, 2018, 12:08pm UTC](https://community.openhab.org/t/binding-development-unresolved-requirements/42897/8 "2018-04-03T12:08:31Z")

</div>

This might be where my problem is. I’m using the 2.2 stable repo and compiling for 2.3 snapshot. I wasn’t aware we couldn’t use 2.3 snapshot bindings in the 2.2 repo, though it makes sense and I don’t know why that didn’t come to mind. I’ll change my repo and see if that clears it up.

---

<div class="post-metadata">

**Author:** ![mladams922](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/f6c823/32.png) [@mladams922](https://community.openhab.org/u/mladams922)\
**Post date:** [April 3, 2018, 12:09pm UTC](https://community.openhab.org/t/binding-development-unresolved-requirements/42897/9 "2018-04-03T12:09:06Z")

</div>

I’m navigating to the directory where the binding is stored and using

```
mvn -e clean install

```

---

<div class="post-metadata">

**Author:** ![matt1](https://community.openhab.org/user_avatar/community.openhab.org/matt1/32/19930_2.png) [@matt1](https://community.openhab.org/u/matt1)\
**Post date:** [April 3, 2018, 12:42pm UTC](https://community.openhab.org/t/binding-development-unresolved-requirements/42897/10 "2018-04-03T12:42:13Z")

</div>

Maven should then be handling the dependancies if they are added.  
By any chance do you have this warning in eclipse?  
DS Annotations missing from permanent build path

If so use the quick fix feature of eclipse to resolve.

I then use  
mvn clean compile package  
and the JAR is then found in the target folder.  
Watch all output and read and fix the warning and errors.

---

<div class="post-metadata">

**Author:** ![gitMiguel](https://community.openhab.org/user_avatar/community.openhab.org/gitmiguel/32/12476_2.png) [@gitMiguel](https://community.openhab.org/u/gitMiguel)\
**Post date:** [April 3, 2018, 1:03pm UTC](https://community.openhab.org/t/binding-development-unresolved-requirements/42897/11 "2018-04-03T13:03:15Z")

</div>

Unrelated question. What’s the difference between `mvn clean install` and `mvn clean compile package`?

---

<div class="post-metadata">

**Author:** ![mladams922](https://community.openhab.org/letter_avatar_proxy/v4/letter/m/f6c823/32.png) [@mladams922](https://community.openhab.org/u/mladams922)\
**Post date:** [April 3, 2018, 3:07pm UTC](https://community.openhab.org/t/binding-development-unresolved-requirements/42897/12 "2018-04-03T15:07:54Z")

</div>

I found the resolution. There were no errors as I kept the binding as simple as possible just to get it to compile and load into OpenHAB. This is my first binding and I’m taking things one step at a time to be sure I do it right.

The fix was simply switching to the snapshot build of the repo. After downloading OpenHAB 2.3.0-SNAPSHOT I added the .jar file to the addons folder and everything loaded just fine.

Thanks for the help and tips to all who contributed!
