A new IDE and runtime for everyone!

(Kai Kreuzer) #61

This is no contradiction. Karaf offers to use either Felix or Equinox. We chose Equinox.

So how do I load an additional addon into the runtime?

Simply by putting it in the addons folder.

(Tobias) #62

Ah well, seems I was skimming the Karaf docs a bit to fast…

Still I don’t get how to load an addon… I created a new OH2 Binding Skeleton in the same folder as the other OH2 Bindings. Now do I have to build them via maven and copy the files somewhere, or can I directly debug them from within the Eclipse setup? I would especially like to test the auto discovery feature (via jmdns).

I’m usually working in other environments (Websphere Liberty and similar), so I might need some time to adjust.

(Kai Kreuzer) #63

Yes, you can clearly test your binding directly in the IDE! Simply make sure it is selected on the launch configuration, see here and run the launch configuration of the runtime.

(laohixdxm2016) #64

Actually peksi’s question is also what I am interested.
But for the “check out from git yourself”, I really do not have much idea about that and which github project to checkout for openhab runtime.Can you expose a little bit more details to do that if possible/necessary?
I notice that on github,there are a couple of projects,
1 openhab2-addons is for addons for openhab2
I understand we can either “mvn package” or import into eclipse as an existing Project.

2 openhab is for addons for openhab1
The same as above.

3 kaikreuzer/openhab-core
I guess this project is the openhab runtime source code project by this name. Also I notice there is no command line instructions in Readme.md of this project.
Is this project only for some internal use within 5 contributors or it can be and supposed to be used by some way by other developers?
Is this project the one you suggested “check out from git yourself”?

4 openhab-distro
For this project, I really have no idea what I can do.
I notice no start.sh we can find under the directoy after extracting.
Also I notice there is no command line instructions in Readme.md of this project.
Is this project only for some internal use within 10 contributors or it can be and supposed to be used by some way by other developers?

As in addition to the openhab2 addons, a openhab2 runtime is necessary, so the only thing now i can find for that is openhab-offline-2.0.0-SNAPSHOT.zip.
It doesn’t look like something “check out from git”, but am I correct at this point?

Thank you very much for your concern. Any information will be greatly appreciated.

(Lolodomo) #65

After setting up a new IDE, I can see with a “git status” that I have several files modified in the following directories:

  • openhab
  • openhab2-addons
  • smarthome
    Only openhab-distro is clean.
    Why ? How is it possible ? Of course, I have changed any of these files myself, I have only executed the Eclipse setup.

Of ocurse, I cannot run a “git pull origin master” in all of these directories. What shall I do ? Remove the files tagged as “modified” (git checkout --) and then run “git pull” ?

Additionally, I can see in Eclipse just after the first setup that several projects are not compiling even after a full clean:

  • yahooweather (ESH Extensions)
  • kostal.inverter (OH2 Add-ins) => problem in pom.xml
  • cornetvisu (OH2 Add-ins) => problem in pom.xml
  • cornetvisu.php (OH2 Add-ins)
  • action.peddle (OH1 Add-ons) => problem in pom.xml
  • rfxcom.test (OH1 Add-ons)
  • smarthomatic (OH1 Add-ons)

Edit: after running “git checkout --” on all files first tagged 'unexpected) as modified and run a new “git pull origin master” and finally a new clean all projects in Eclipse, I can confirm that the same compile errors in Eclipse are still present.

(Thomas Moulton) #66

ok i am attempting to fix an open issue on modbus… followed the install directions fine but a few eclipse problems…

Project 'org.openhab.binding.smarthomatic' is missing required source folder: 'src-gen/main/java' org.openhab.binding.smarthomatic Build path Build Path Problem Project build error: Unknown packaging: eclipse-plugin pom.xml /org.openhab.action.pebble line 24 Maven pom Loading Problem src-gen/main/java/ is missing from source.. build.properties /org.openhab.binding.smarthomatic line 3 Plug-in Problem src/test/java/ is missing from source.. build.properties /org.openhab.binding.smarthomatic line 1 Plug-in Problem The folder "bin/" does not exist in the workspace build.properties /org.openhab.binding.smarthomatic line 8 Plug-in Problem The JRE container on the classpath is not a perfect match to the 'JavaSE-1.7' execution environment MANIFEST.MF /org.openhab.binding.smarthomatic/META-INF line 32 Plug-in Problem

If these are too far off topic the if someone would PM me that would be great…

(Stefan Endrullis) #67

Thanks for the IDE setup guide. I’m glad to read that the build process is “completely mavenized” and it should be possible to use other IDEs (Netbeans or Intellij IDEA) as well. Since I’m working with Intellij for more then 12 years now I would like to stick to it and setup Intellij IDEA for developing bindings for openhab 2.

My usual starting point for setting up my IDE is a console guide. Something like:
git clone …
cd …
mvn …


Since your using maven as well I would guess that such a guide would be possible. It’s a pitty that this information is currently hidden in this Eclipse install procedure. I assume that Eclipse users that do not want to reinstall Eclipse would be interested in such a console guide as well.

Is there any documentation (e.g. a script) about which repo has to be checked out in order to compile and run openhab 2.0 with some addons?

(Thomas Moulton) #68

Did I miss a step? I get a bunch of these errors:

[ERROR] Unknown packaging: eclipse-plugin

(Kai Kreuzer) #69

This does not seem to be any problem with your IDE setup, but these are rather errors in the smarthomatic binding. It seems as if it was never fully checked before being merged. @teichsta, Could you have a look, please?

Note that the build uses Maven Tycho, so dependencies are resolved through p2 repositories and not Maven repos - I do not know, how well IntelliJ supports Tycho. Feel free to figure it out yourself and if you have success you can add a section in the IDE setup documentation.

Is there any documentation (e.g. a script) about which repo has to be checked out in order to compile and run openhab 2.0 with some addons?

The repos are listed here: https://github.com/openhab/openhab-distro#openhab-2-distribution
You should only checkout and build the stuff that you want to work on, so for an openHAB 2 binding, the openhab2-addons repo is sufficient. The build result (the jar of your binding) can then be simply dropped into a normal distribution in the addons folder. Alternatively, you can build the openhab-distro yourself and it will pick up the openhab2-addons from your local Maven repo, if you have built them before.

(Thomas Eichstädt-Engelen) #70

yes, i had a look.

What i fixed is the initial checkout of the src-gen folder which works fine now. Now you get 77 errors because the generated sources are not available. These errors disappear (as with the src-gen error, too) after a full mvn clean install.

(Stefan Endrullis) #71

Thanks for this information! That’s exactly what I needed. I’m glad that I can remove the eclipsesmarthome repo again, since it consumes 2.5 GB on disk.

(Thomas Moulton) #72

Ok I started over and created a new workspace following the instructions.
This time I did take the suggested step of opening the openHAB_Runtime" launch configuration

I get the error Project build error: Unknown packaging: eclipse-plugin

Which after a search references Tyco…

I am just wanting to build OH1 can anyone suggest why I am having a problem when so many seem to follow those instructions without a hitch?

When I open the POM for most packages I see eclipse-plugin listed as the “Packaging” but eclipse-plugin is not a choice in the pull-down list


(John Cocula) #73
git clone https://github.com/openhab/openhab.git
cd openhab
git checkout 1.8
mvn clean install

To have IDE support for pure OH1, if you really need it, you could resurrect the old IDE instructions here. But be sure you actually need it before going to the trouble—you can do OH1 addon development and testing using the new IDE setup, and it’s much cleaner than previous.

(Thomas Moulton) #74

I have the new IDE installed, I do not want to go backwards, otherwise I will have issues later.

So any suggestions on getting the maven/tyoc eclipse-plugin packaging?

I am using Ubuntu 15.04


(John Cocula) #75

Wise. Have you just removed the failing projects from the IDE for the time being? I’ve not experienced what you’re seeing, sorry!

(Thomas Moulton) #76

Ok I tried this

and it also failed… (i guess the only thing to do is try the OLD ide next)

Exception in thread “main” java.lang.NoClassDefFoundError: org/codehaus/plexus/interpolation/InterpolationException
at org.eclipse.tycho.core.osgitools.BuildPropertiesParserImpl.interpolate(BuildPropertiesParserImpl.java:117)
at org.eclipse.tycho.core.osgitools.BuildPropertiesParserImpl.parse(BuildPropertiesParserImpl.java:67)
at org.eclipse.tycho.core.osgitools.project.EclipsePluginProjectImpl.(EclipsePluginProjectImpl.java:37)
at org.eclipse.tycho.core.osgitools.OsgiBundleProject.getEclipsePluginProject(OsgiBundleProject.java:266)
at org.eclipse.tycho.core.osgitools.OsgiBundleProject.readExecutionEnvironmentConfiguration(OsgiBundleProject.java:492)
at org.eclipse.tycho.core.resolver.DefaultTychoResolver.setupProject(DefaultTychoResolver.java:92)
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:72)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:266)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.interpolation.InterpolationException
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
… 21 more

(Thomas Moulton) #77

That failed too…

maybe I need to start over…

I am running Ubuntu 15.04

Can anyone build on that?

I do not need the IDE for the most part, right now I just want to build and test some changes


(John Cocula) #78

This is kind of a guess, but do you have the Oracle JDK installed or OpenJDK? The Oracle JDK might be better…

(Slawomir Jaranowski) #79

@w2vy - this error looks like old version of maven
Can you show output of: mvn -v

(Thomas Moulton) #80

Apache Maven 3.3.3
Maven home: /usr/share/maven
Java version: 1.8.0_74, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: “linux”, version: “4.2.0-30-generic”, arch: “amd64”, family: “unix”