IDE setup on Windows - tips needed

Hello,
I have been wanting to setup the dev environment on my W7 laptop, but had some major problems.
I tried the ‘Pure Eclipse’ variation at https://github.com/openhab/openhab/wiki/IDE-Setup.
If anyone can suggest some pointers, or provide a walkthrough, that would be super! :smile:
Also, I assume if I want to start tinkering with bindings etc, it would be better to do so in the OH2 environment, given all new bindings need to be OH2 compliant? Would https://github.com/openhab/openhab2/blob/master/docs/sources/development/ide.md be a better place to start?
Cheers!

I was just about to start a new topic, but my concerns are almost the same as yours. To answer your question: whether to set up an OH1 or 2 IDE highly depends on which version you want/need? As far as I understood it, the two versions do not share a common target definition and can thus not be developed in the same dev environment.

My goal is to set up a dev environment for OH2 for migrating my 1.x bindings (Windows 7), and these are the steps I did so far:

  1. I followed this guide: https://github.com/openhab/openhab2/blob/master/docs/sources/development/ide.md
    This installer is awesome! The resulting IDE is almost completely functional :smile: At least everything compiles successfully.
  2. The launch configurations were incomplete, so in “Run” - “Run Configurations…”, “Plug-ins” tab, I had to push Add Required Plug-ins and I also added some org.eclipse.smarthome.xxx bundles which I think are needed. Then removed all org.eclipse.ui and org.eclipse.e4.ui bundles because I don’t think they are needed for a headless application :wink:
  3. Running this configuration does work, the console shows this output: http://pastebin.com/qKCN2saH
  4. Access to the UI via http(s) on ports 80, 8080, and 8443 fails, also the osgi console command ‘openhab’ does not work.

So how do I access any UI or console of OH2? Does it differ that much from OH1?

Btw, using maven to build OH2 and running it afterwards, works fine.
It is even possible to run maven from inside Eclipse (I think via the m2e feature), no need to install it separatly:

  • Run - Run Configurations… - new Maven Build
  • Base directory: ${workspace_loc}/…/git/openhab2
  • Goals: clean package

@Kai maybe such a launch config could also be added to ‘distribution’ project?

Feel free to create a PR for it!

We encountered the same decision (dev for oh1 or oh2?!) a while ago when we wanted to connect several small devices to openhab. After a heated discussion we agreed to start directly with OH2 and we still dont regret it. Although the versionnumber indicates an unstable release (alpha :open_mouth:) we are currently very pleased with the reliability and performance in our university lab.

Regarding your problems: It looks like you re missing some smarthome bundles, have you selected the OpenHab2 target plattform? (windows->prefs->plugin dev.->targetplattform)
After applying the plattform it takes quite a while to download all the packages due to the (sometimes very) slow eclipse network.

Have you tried to re-run the whole installation? Most of the times this saves you a lot of hassle :wink:

Done: https://github.com/openhab/openhab2/pull/342

I’m still wondering what is missing for running the OH2 runtime directly in Eclipse.
@Kai: in your screencast, the run configuration works without conflicts. I did a fresh setup via the installer but in the run configuration, there are plenty of plug-ins missing when pressing ‘Validate Plug-ins’. After ‘Add Required Plug-ins’, the runtime starts with the log posted above, but neither the Dashbord nor any other service seems to be available. Any idea what is missing?

Yes and yes. Thanks for the suggestions anyway.

Ok, I got it up and running :smile:
No idea why, but several jetty bundles were missing in the launch config?!

I don’t have an idea either. I just did a full new fresh install for a test and the launch config does not show any error. In such cases as yours, it might help to run Help->Perform Setup Tasks....

Cool, thanks!

Hello all.
I finally got the IDE running for OH2.
I wish to examine the code for a OH1.7 action, but can’t figure out how to import it into the IDE.
Any suggestions?
Thanks in advance :slight_smile:

Should work exactly the same way as I show it here for Eclipse SmartHome bundles: https://www.youtube.com/watch?v=xSi0-ZwDbTc&index=4&list=PLGlxCdrGUagyDLSdoOUAmwsf4RD7URP4u
Hope this helps!