Missing dependency running the demo app in eclipse

Hi All,

I have spent the last 2 days trying to get a full development build running and I am at the point now where I can actually get to start/run the demo app using the osgi buttons.

I am new to java/maven/eclipse having come from vs .net so any advice as to what to do to resolve below error would be appreciated. I have only copied in the first few.

-> Export-Package: org.openhab.core; bundle-symbolic-name=“org.openhab.core.boot”; bundle-version=“2.5.0”; version=“2.5.0”
org.openhab.core.boot [84]
Unresolved requirement: Import-Package: org.eclipse.smarthome.model.sitemap; version="[2.5.0,3.0.0)"
-> Export-Package: org.eclipse.smarthome.model.sitemap; bundle-symbolic-name=“org.openhab.core.model.sitemap”; bundle-version=“2.5.0”; version=“2.5.0”; uses:=“org.eclipse.smarthome.model.core,org.eclipse.smarthome.model.sitemap.parser.antlr.internal,org.eclipse.smarthome.model.sitemap.sitemap,org.eclipse.smarthome.model.sitemap.validation”
org.openhab.core.model.sitemap [111]
Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:=“optional”
Unresolved requirement: Require-Bundle: org.apache.commons.logging; resolution:=“optional”
Unresolved requirement: Require-Bundle: org.eclipse.emf.mwe2.launch; resolution:=“optional”
Unresolved requirement: Require-Bundle: org.openhab.core.model.lazygen; resolution:=“optional”
Unresolved requirement: Require-Bundle: org.eclipse.xtext.generator; resolution:=“optional”
Unresolved requirement: Require-Bundle: org.eclipse.xtext.util
-> Bundle-SymbolicName: org.eclipse.xtext.util; bundle-version=“2.19.0.v20190902-0737”
org.eclipse.xtext.util [53]
Unresolved requirement: Require-Bundle: javax.inject; bundle-version=“1.0.0”; x-installation:=“greedy”; visibility:=“reexport”; resolution:=“optional”
Unresolved requirement: Require-Bundle: com.google.inject; bundle-version=“3.0.0”; visibility:=“reexport”

Eclipse does have lots of error’s but I am able to run mvn skipping tests and checks in all folders except webui.

Did you choose 3.0 branch?

What errors does it show? It may be related. :wink:

I have re-installed again and investigating why the projects in core have errors they all relate to to pom.xml and itest.bndrun.

However when I try and run the test I am getting a different set of errors depending on which version of java I target. This is a truncated version of the console with java 11.

                                      jollyday [9]
                                        Unresolved requirement: Import-Package: javax.xml.bind
                                 Unresolved requirement: Import-Package: de.jollyday.util; version="[0.5.0,1.0.0)"
                                   -> Export-Package: de.jollyday.util; bundle-symbolic-name="jollyday"; bundle-version="0.5.8"; version="0.5.8"; uses:="de.jollyday,de.jollyday.config,javax.xml.bind"
                          Unresolved requirement: Require-Bundle: org.eclipse.xtext.util
                            -> Bundle-SymbolicName: org.eclipse.xtext.util; bundle-version="2.19.0.v20190902-0737"
                          Unresolved requirement: Require-Bundle: org.openhab.core.model.item
                            -> Bundle-SymbolicName: org.openhab.core.model.item; bundle-version="2.5.0"
                          Unresolved requirement: Require-Bundle: org.eclipse.xtext.xbase; visibility:="reexport"
                            -> Bundle-SymbolicName: org.eclipse.xtext.xbase; bundle-version="2.19.0.v20190902-0952"; singleton:="true"
                   Unresolved requirement: Import-Package: org.eclipse.smarthome.model.script.engine; version="[2.5.0,3.0.0)"
                     -> Export-Package: org.eclipse.smarthome.model.script.engine; bundle-symbolic-name="org.openhab.core.model.script"; bundle-version="2.5.0"; version="2.5.0"; uses:="org.eclipse.smarthome.core.thing.binding,org.eclipse.smarthome.model.script.engine.action"
                   Unresolved requirement: Import-Package: com.google.inject; version="[1.3.0,2.0.0)"

OK that explains. In Java 11 javax.xml.bind is no longer available by default. It’s best to use Java 8 when doing development on the 2.5.x branches.

In the master branch (OH3) Java 11 is supported/required. It is possible to use Java 11 with the 2.5.x branch. However you first need to update the bndrun files like I did in:

You can then update

-runee: JavaSE-9
-runee: JavaSE-11

and use that bndrun file for launching OH 2.5.x with Java 11. :slight_smile:

Thanks. I will see if I can apply the manual fixes and get the demo to launch with 11 later.

I merged back those changes from the master to 2.5.x so it’ll be easier to switch between those branches while running Java 11, so if you update the branch you should be able to use it straight away, see:

1 Like

That has worked a treat now that I have gotten back to it. much appreciated.

Wasn’t sure how to refresh but doing a git pull in the openhab-distro folder worked however the same didn’t work in openhab-addons. I got errors below

error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.

I don’t think I have changed anything as yet so just interested in how I can force a pull.

So I am now at the point where it starts with a few warnings but prompts me with a login when i browse to http://localhost:8080/paperui.

Now that it is running , regardless of the fact i can’t login is great but I not sure if the demo is for a 2.5 or 3 core and how do i switch between them.

It’s a bit picky but it’ll probably work if you add a / :


To update the addons you typically want to:

  • commit your changes
  • fetch changes from the origin (if that’s the name of your upstream OH remote)
  • rebase your branch on origin/2.5.x

That can be done using the IDE or command line. If you’re working on a new add-on there’s typically no reason to update the addons, unless you want to sync the version numbers. :wink:

Huh. who knew slashes made such a difference .

I didn’t think i made changes so no reason to commit but accept the fact that eclipse/git install thinks so.

stay safe in these times

Okay so you have gotten me this far so whats next.

Sometimes it already automatically makes some changes after importing projects. You can probably revert those.

The next step could be to see if you can also debug an existing add-on like astro:

After that you can help fixing one of the hundreds of issues or maybe enhance an existing addon Once you know how that all works you might take on something more complicated like building a new add-on. :wink:

Just in case you don’t already know:

# git status

will tell you which files git thinks have changed and

# git diff <file>

shows what git thinks the changes are in that file (assuming that you haven’t git added the file)

my OH addons folder in the project was empty so i did a git reset --hard HEAD and the pull request then worked and I added the folder to the workspace doing a folder import.

followed the rest of the guide and can see the astro binding in the paperui.

I cant work out now how to get into the debugger to set any break points as I have never used eclipe or java and I think something is also wrong with the addons as all I see is the name of the binding with no subfolders/src code visible

I’ve created a PR so there are no longer unstaged changes after importing projects and it also fixes almost all errors:

You can toggle a break point on/off in Eclipse by double clicking at the beginning of a line of code so you see a small blue dot. Another way is right clicking at the beginning of the line so you’ll see a menu that has the “Toggle Breakpoint” option.

In the screenshot below I enabled two breakpoints in the initialize and dispose methods of the AstroThingHandler so you can debug the initialization and disposal of Astro Things.

As you can see on the right there’s also a “Breakpoints” view that lists all breakpoints. It’ll probably show automatically when you open the “Debug” perspective when you click the bug icon in the top right corner.

Also make sure when you start the application you use the “Debug OSGi” option instead of “Run OSGi” or it will not use the breakpoints.

Thanks for all of the help so far. Had a bit of an attempt to get the current install working but had no success and I am waiting for a fresh install to finish.

Unfortunately in the same situation still. I can add the astro binding and run in debug but there is no source in the project for the addons and the addons folder is empty in eclipse.

It doesn’t import any add-ons automatically. These need to be imported manually because Eclipse doesn’t perform well when all add-ons are automatically imported.

See step 11. of the documentation:

  1. If you have selected openHAB Add-ons the installer will clone the openHAB Add-ons repository.
    To get an existing binding project into Eclipse import it as a Maven project.
    Goto File -> Import... -> Maven -> Existing Maven projects and follow the wizard to select the directory of the binding or bindings to import.


I have successfully loaded the astro binding into the project and set the breakpoints and the astro binding is running. However the breakpoints were never hit and I don’t see any debug info.

What have I missed?