VSC: how-to resolve imports org / osgi + eclipse + apache?

How does one resolve imports using the VisualStudioCode environment ?

Lots, not to say all, *java code uses import references and I want/need to resolve the code in such a way that theŕ’re no syntaxis errors on the code.


Note: VSC is complaining that it can’t import the for/on the underwringled-lines.

Note: I can perfectly (re)compile using MVN (commandline), the same as MAVEN task inside VISC and use the resulting “bundle” for openHAB.
So, I assume the MaVeN can ffind erverything and now I woudl ike to have the same for the code-editor

Note: disclaimer novice level, I feel like searching a ghost the dark using IDE’s and thought things compile, I do not yet understand where and how the required (importing) code and frameworks are retrieved and what their precise context/role is. I my long past, I used to simple combine things myself but here I must rely a framework that’s (at least for me to say), a dark hole.

TIA

If you enable View> Problems, what is reporting the problem?

What did you import? From your screenshot it looks like the old eclipse smarthome project?

I guess the code/version/level/release has not much to do how VSC will resolve the sourced import statements…

Note: I’m still using this so-called old release as this is perfectly working on my QNAP/Nas and I prefer not to change things there by new. Also as this Qnap/Nas installation is heavily changed to make it working (for me). My focus for now is to fix the “code-environment” before I step into upgrading.

The question is merely, what must one do to let VSC resolve the OSGI/Eclipse/Apache stuff used by but (of course) not part of the openHAB sourced download.

The imports can not be resolved…

It certainly does matter. The build system used has been changed in 2019 and that made it possible to use other ide’s, and that is where the new other ide instructions are targeted for. The eclipse smarthome build system is tightly coupled with eclipse, making it very hard to use it with other ide’s. It doesn’t help that eclipse smarthome has been archived and all links used in the build are not directly accessable any more. I guess it still works for you because it’s all cached locally on your system.

To summarize, I would not recommend spending anymore time getting this to work and instead research what it takes to upgrade. If you have specific add-ons modified you might see if the new version still work on your system. Depending on how old it is there might be minimal differences that you could locally rework to make it work on your system. Also while the build system was changed this has no impact on how the binding itself works. A jar build with the new build system works on a system build with the old build system (besides any possible incompatibilities in code of course)

Thanks very much for your explanation, patience and things brightly come together.

The fact, that things are cached in my woodshed, made it apparently possible that I could continue “playing” the field. And indeed that Eclipse “suddenly” archived things while I lived under a massive rock, did not make my life easier. In some past, I tried & used to crunch “Eclipse IDE” but never liked it to eat, done things on the commandline only and “tricked” the openHAB-ECO system in swallowing my changes.

Indeed, I fully agree not spending (much more) time into keep the old wagon on the road. The challenge now (for me) is to a) refresh my only one “old” QNAP/NAS and b) to reinvent “my” development environment.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.