Eclipse Bindings Environment Setup Issues

eclipse
Tags: #<Tag:0x00007f51decbc5f0>

(Tim Harper) #1
  • Platform information:
    • Hardware: Intel i7 / 24GB / plenty
    • OS: Mac OS
    • Java Runtime Environment: 1.8.0_162
    • openHAB version: 2.4.0
  • Issue of the topic: Cannot import OpenHab addons into Eclipse; using existing projects but “org.eclipse.smarthome” dependency is missing.

I’ve been following the instructions, several times, to install OpenHab2. I followed the instructions here: https://www.openhab.org/docs/developer/development/ide.html (I had to install a product version 2018-09 due to conflicting OOMPH dependencies in 2018-12). I had things working at one point, but I moved the project so I deleted it from eclipse and re-imported it using “import existing project from filesystem”. No matter how many times I import the project, I get this:

It’s got a few dependencies in there, but it’s missing org.eclipse.smarthome.core.*; Things build just fine from the command-line.


(Tim Harper) #2

I destroyed everything and reinstalled the IDE from scratch (2018-09 version; 2018-12 still is broken), selecting to include the relevant OpenHAB github projects. Now it seems to be working.

I wish I understood why it quit working, and how to fix it in the future. Maybe there’s some special magic about how the OOMPH installer imports the project?


(Tim Harper) #3

Well, I spoke too soon; I closed eclipse, and then opened it again, and everything’s broken again. The org.eclipse.smarthome dependencies all “went missing” from Eclipse’s point of view, and I have no idea why :frowning: I was making some good progress on the homekit extension for OpenHab2, but now everything’s broken again.


(Tim Harper) #4


(Tim Harper) #5

This looks important; MANIFEST.MF is being used, it seems, but for some reason I see “no available bundle exports package” for all of these dependencies, which happen to be the ones that aren’t seen by Eclipse causing everything to fail.


(Tim Harper) #6

Ugh, after giving up and wasting several hours of precious open source contribution time, I blew away everything and reinstalled. I installed photon this time rather than 2018-09 (2018-12 still fails horribly).

Now everything’s happy again.

It looks like a plugin target isn’t even used?

Here’s some screenshots where things are happy:

I hope I’m an outlier. I’ve had an absolutely terrible time contributing. Information on how to diagnose these types of problems seems sparse. I have no idea what broke with my IDE. In paranoia I’m keeping backups of it in case if it happens again.


(Tim Harper) #7

Okay, so I quit the editor, and reopened it, and everything’s back to broken again.

It looks like OOMPH does some setup task that doesn’t persist?


(Jerome Luckenbach) #8

I have Problems Like this too.
Eclipse is a pain in the ass if you are not very familiar with it.
At least this is my impression.

I tried it several times on Ubuntu and windows and after some Setup Tasks everything is broken.

I have the impression that there are a bunch of people with no Problems at all and others who can try as hard as possible but nothing seems to work.

I have decided to pause my work for a binding.
I am not interested in having to fix ide problems every time I start it.
That is useless and I can spend that time better.

I can’t guess what the problem could be and I can’t read it out of the error messages.

Maybe you are able to dig into this better than I am.
Would be really nice to have a reliable ide again.


(Tim Harper) #9

Okay, I was able to restore IDE functionality.

I went to “Help > Perform Setup Tasks…” and chose to re-run all setup tasks. Then I opened in my project explorer “Infrastructure > launch > openhab.target”, and clicked the link “Set as active target platform”. After this, it worked.

I restored my backup to see if I could reproduce the issue; I could. Simply setting the openhab.target worked.

A video for those struggling with this issue, to offer encouragement if nothing else:


(Jerome Luckenbach) #10

If that works for me too, you are my hero^^


(Tim Harper) #11

I hope it does; earlier I swear I had tried this exact same thing with a 2018-09 install; I wiped everything and installed Eclipse Photon using the Oomph installer.

I selected these:

Installed, went through to welcome screen, everything worked. Quit Eclipse, re-opened it, and everything was broken again. Then I went and opened, in my project manager, Infrastructure > launch > openhab.target openhab and clicked “Set as active target platform”, and things worked.

One thing I learned through this is that even though maven can build OpenHab bindings, you shouldn’t try and use it in Eclipse. Eclipse and Maven both read from the Manifest.md file to find dependencies, and the resolution sources for those dependencies are found in the active target platform. This is the world of OSGI. I suspect that the majority of people that have no trouble with their IDE also are familiar with OSGI. Then, the rest of us who struggle, have very little experience.

Perhaps some tutorials on OSGI in the context of OpenHab2 development would be in order. I spent several tear-filled hours butting my head against this and trying to understand what I was missing until I found this. Hopefully my “trail of tears” I’m leaving here in the forums provides a hint or two to others so they can emerge from the painful condition more quickly.


(Jerome Luckenbach) #12

I am trying a fresh install next days and see if i can reproduce this.
I am pretty sure that i will have problems after restarting the fresh install, so i can test this.


(Tim Harper) #13

I’ve opened eclipse several times over the weekend after several computer restarts, and it’s stayed working.

My guess is that the issue I’ve been encountering is that either OOMPH does not persist the active target platform, or something I’m doing is causing the active target platform to change.


(David Graeff) #14

The current build system is crap, but that is known and being worked on :slight_smile:


(Jerome Luckenbach) #15

Does the current build system also affect the target plattform for debugging?
(Sorry, i am totally a noob in this ide/maven/tycho stuff and climb from one docs article to the next.)


(Örjan Backsell) #16

Hi!
I can just agree to what Confectrician say, about noob I mean.

And I have problems as described in : Problems with PaperUI, Rest Api after IDE installation
This problems started after I have done an new installation of the IDE, Version: Photon Release (4.8.0)
Build id: 20180619-1200 for about a week ago, before was everything working. ( I had to reinstall due to other reasons)
Could it be that we just have to wait until the system is OK again?

BR Basse


(Tim Harper) #17

I’m not totally experienced in OpenHab development (nor do I program Java much lately), but the end result is workable once you figure out the kinks. It’s really strange (and surprising) to have Maven and Eclipse use different build configuration. Unification there would be really nice, and perhaps pave the way for more IDE flexibility (IntelliJ / netbeans / etc).


(Jerome Luckenbach) #18

These “kinks” are something we should definitely add to the docs at some time.
I had some constructive and nice talks at last smarthome day about the development documentation
and will try to push this forward, when my todo list got a bit shorter.


(David Graeff) #19

Better not do that the next weeks :slight_smile:


(Jerome Luckenbach) #20

You don’t seem to know my todo list. :smile:
No worries. That’s a long term topic for me.