Eclipse Bindings Environment Setup Issues

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?

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.

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.

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.

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?

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.

3 Likes

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:

2 Likes

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

1 Like

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.

2 Likes

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.

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.

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

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.)

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

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).

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.

1 Like

Better not do that the next weeks :slight_smile:

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

Awesome, I just had the thing happen where I opened Eclipse after a few days, and all the dependencies were broken again (as observed above). Openhab was still my target platform. I opened the openhab.target platform file in the launch project (openhab-distro); in the definition tab, the three listed locations were reported as erroneous. I clicked “Reload Target Platform” and everything became happy again!