We are currently reworking how to setup a perfect development environment. A new step by step guide will appear here soon.
For now follow these steps:
Eclipse IDE Setup
This guide focuses on existing Add-on (binding) development.
Download the "Eclipse Installer": can be downloaded from the Eclipse web site
Launch the Installer and on the menu on the top right (3 bars) select
ADVANCED MODE..., then select
Eclipse IDE for Java Developers. Ensure that you select the Eclipse version to use to "2019-03" as version
2019-06currently does not support bndtools. Finally select
Github Projects > openHABselect
openHAB Developmentand any desired option from
openHAB Add-ons(includes all add-ons from openhab2-addons repo),
openHAB ZigBee Bindingor
openHAB Z-Wave Binding.
Next>, verify/modify Root and install folder name, click
Finishto start installation. During install accept licence agreement, "Unsigned Content" for Bndtools, and Eclipse Foundation certificates when requested to complete IDE installation. When the Eclipse installation is finished the IDE is launched automatically.
It's important, during the first Eclipse IDE launch, to leave Eclipse open until all openHAB related initial Setup tasks / Download sources / Builds are completed.
Setup tasks will personalize the IDE with openHAB code formatting tools, configurations and a demo app. Setup tasks will also download openHAB lastest
openhab-distrocode repositories and related maven dependencies. Click bottom right button in the IDE for Progress.
When visible in the Package Explorer, select
OH2 Add-onsand from right-click menu select "Close Projects": this significantly speeds up the setup. Re-open only the binding project(s) you would like to work on.
It may take 30-45mins for all initial tasks to finish, depending on internet connection and your computer speed. So... go and grab a good cup of coffee and be patient until is finished
After all tasks are finished, look for
app.bndrunfile in the Eclipse Package Explorer in
Infrastructure > launch > appproject folder. Double click to open
app.bndrunfile (takes a few seconds)
Under Browse Repos search for the binding you want to run/debug (
astroin our case) and add it to the "Run Requirements" list using drag&drop from the "Browse Repos" list:
NOTE: If the binding you want to run/debug cannot be found in the Browse Repos list, or the list is empty, then follow these steps to rebuild the list of bindings in the BOM (Bill Of Material) and make your new binding visible from the IDE launch configuration:
- using Git bash console go to
- recreate the BOM with:
mvn -DskipChecks -DskipTests clean install
- go back to Eclipse, close and re-open the
app.bndrunfile and now you should be able to find the binding in the list
- using Git bash console go to
Save and click "Resolve": a window with the list of resolved bundles will be shown. Click
Finishand save the file.
Now the IDE is ready to start openHAB with a minimum set of the openHAB core bindings, UIs and the selected binding you want to run/debug.
Start openHAB from the IDE clicking "Run OSGi" or "Debug OSGi" (upper right of the
You can check openHAB is running going with your browser to: http://localhost:8080/paperui/ (the last
Check the chosen binding is active in
Paper UI > Configuration > Bindings