Import a binding in eclipse an later compile to a jar


for testing i want to change a xml file of a my device in zwave and then compile the zwave binding and make a jar file for oh2

i installed now the eclipse ide and i try to import the zwave binding and later the oh2 snapshot. but in both i get over 1000 errors. i mak a clean project but it doesnt help. I try to export the zwave binding to a jar file but it was much bigger then the file from the snapshot. i dont find any manual which can help me import and compile a binding. I google for many hours and nothing help, i am frustrated now
maybe Chris Jackson can or othe guys here help

best regards

This is how I use to do it, the first part is regarding Installation of Eclipse openHAB2, just leave it if you as I assume already had it installed.

  1. Download the Eclipse Installer

  2. Launch the Eclipse Installer and switch to “Advanced Mode” in the top right menu:

  3. Choose the “Eclipse IDE for Java Developers” and select “Next”:

  4. Expand the “Github Projects / openHAB” entry, double click “openHAB Development, openHAB 2 Add-ons, openHAB 1 Add-ons, Eclipse SmartHome Extensions, ESH + OH2 Core Bundles” (the double click is important: The entry has to appear in the empty table at the bottom). Furthermore double-click all entries that you would want to have available in your workspace (you can select multiple/all of them). Make sure that all of them are listed in the table at the bottom and select “Next”.

  5. Select Show all variables. Now provide an Installation folder name (don’t use spaces in the path on Windows!) and your Github id (used to push your changesets to) set Workspace location rule: till /home/‘user’/eclipse-smarthome and select “Next”.

  6. The installation will now begin when pressing “Finish”.

  7. Once it is done, you will see the Eclipse Welcome Screen, which you can close by clicking “Workbench” on the top right. You will see that the installer not only set up an Eclipse IDE instance for you, but also checked out all selected git repositories and imported all projects into the workspace. This could take some time

  8. Now select “Help->Perform Setup Tasks…” from the menu and click “Finish”:

  9. To remove the very last errors in the workspace, run a “project clean” on all projects that still show errors:

  10. Run openhab in IDE Run / Run or in Package Explorer Infrastructure / Right click openHAB_Runtime.launch / Run As / openHAB_Runtime

Note that you will find the sources in a subfolder called “git” within your selected installation folder. You can use any kind of git client here, if you do not want to use the git support from within the Eclipse IDE. If you want to push changes, you need to do so to your personal fork of the repository in order to create a pull request. You will find more details in the “How to contribute” documentation.

Edit binding part:

  1. Edit the binding.
  2. Do some test’s
  3. Export the new binding,
    Right click the binding in Package Explorer.
    Tab Java
    Choose JAR file
    Select prefered binding under Select the resources to export.
    Select Export generated class files and resources or and the resources you prefer to export and everything in Options.
    Under Select the export destination,choose directory Browse and filename as: org.openhab.binding.XX.jar

4.Seems like you have to edit the MANIFEST.MF file manually. So open your exported binding in some texteditor and copy all text from Eclipse IDE Package Explorer /META-INF/MANIFEST.MF to the MANIFEST.MF file you just opened , save and let the .jar upgrade.

I do hope this work’s otherwise Please let me now.




thanks for your manual :slight_smile:
I do exactly what you write, but i dont understand point 10. What must i do here. See my screenshot form eclipse

best regards

My very kindest excuses for the delay, I have totally missed your question.
This point describes how you start openHAB from inside Eclipse.
So you can either start openHAB from the Run Tab and then Run in the upperside in Eclipse, or you can start from the Package Explorer Window in Eclipse( mostly to the right)

Regards Örjan