Trouble with IDE setup for Linux

Hello everyone,

I am trying to start plugin development for OH2 and in order to do that I need a development environment first.
I have used Eclipse for smaller things before but mostly C development and as such I am not an expert at all in this regard.
The problem I have right now is that the tutorial for the IDE setup asks me to install Eclipse via an installer. That is not how things work in my Linux distro though. When I install Eclipse via my package manager there are no options to select OH2 or anything before installation.
When browsing the GitHub repositories I find multiple individual repositories that contain the individual parts and one (openhab-distro) that pulls them together to compile the final product. I am assuming it does this via maven.
So is it enough for me to just pull all the repos manually and then stuff them in an Eclpise workspace? (I am assuming no)

Any advice would be appreciated!

Answering my own question here:
After doing a bit of guessing I googled for “project provision eclipse” and found a forum thread that explained that this feature is called oomph and that you can do project provisioning after installation as well.

The way to do this is to go to "File -> import -> Oomph -> Projects into Workspace"
This did however not go smoothly. First it tried to clone the git repo into the git installation dir and was luckily not able to get access rights to this folder.
The reason this happened was that the clone rule that was selectable was cryptic and I just left it at its defaults.
Another thing that was weird was, that the configuration settings for the project provisioning were much simpler than what was visible in the tutorial video. For example the workspace rule input field did not exist.
After fixing the checkout location rule and running for a while, and then restarting, it showed me a workspace with a lot of packages in it.
I then tried to run OH2 from the IDE like it is described in the tutorial. This ended in some internal error message. The details mentioned installing some vm.
I then did what I always do when something in linux doesn’t run and executed Eclipse as root.
The default workspace was wrong and so i had to change to the already created workspace from the other user.
Now suddenly I got the same project provisioning settings input mask as in the tutorial video. After completing the inputs it redid the entire installation it seems.
I have no idea why I had to do everything again but it actually succeeded in installing everything and I was finally able to run OH2 from IDE and access it via the browser.

Could someone explain to me why I needed to run Eclipse as root to make it work?
Why was I getting different settings when not running as root?
Why did I have to reinstall the OH2 project after switching to root?

Should we have a special Linux section in the IDE setup tutorial?

1 Like

Thank you for posting your solution to your problem. Far too many people solve their problem themselves and then never say that they fixed it or just say they figured it out without saying how.

I can’t really answer your specific questions but I can only guess. When you run Eclipse it creates a workspace folder somewhere, usually in your home directory in .workspace. Each user gets it’s own workspace. When you ran Eclipse as root it recreated the workspace for that user and perhaps that freshly created workspace created after you did the Oomph import is the difference.

I just used the oomph Linux eclipse installer and installed to my local users bin directory. That way I can separately update eclipse for oh development. That’s quite important because oh usually takes its time before it works with a newer eclipse version (or the packaged eclipse version).

Cheers David