How to play around with a bundle source code without Eclipse?


(Aurelio Caliaro) #1

I would like to take the source of the binding and play around with it in my system by putting the binding source to /usr/share/openhab2/addons (on Openhabian). Ideally I would then edit the .java files with my preferred editor and check if it works or not.
Is there a way to achieve this? I tried downloading the source from github (openhab2-addons), isolate the source of the binding I want to edit (just that directory) and then put that directory tree as a .jar into the …/addons directory. However it does not work because it misses META-INF and MANIFEST.MF.
Has anybody an ‘easy’ way to do such a work without using Eclipse?


(G H) #2

The ESH/OH build is so inter-dependent, its going to be vastly easier to just follow the directions and use Eclipse. Why would you want to make it harder?

There are bindings that can build stand-alone and live in independent repos, but there’s only a few. If the one you want to monkey with isn’t one of them, its not trivial to adapt it to build independently. (I have a few that do, and its a lot more effort, and its fiddly to get everything set up right.)

I’m also not sure you can compile without using the Eclipse compiler – even the stand alone repos build using the Eclipse tooling. (The eclipse compiler isn’t 100% identical to the java compiler, and there’s definitely things that don’t build properly in one vs the other.)


(Pali) #3

Jar files which are deployd to openHAB addonds folder, need to be OSGi bundles. So if you want to change source code of the binding, you need to compile the codes to OSGi bundle and for that you need Maven.


(Aurelio Caliaro) #4

Thank you both, @dotorg and @pauli_anttila. I will then have to use Eclipse in some way.