I’m new on Java and ItelliJ. I have downloaded IntelliJ because I use phpStorm from the same company and known the interface. I work on Windows 10. My OpenHab is on a Debian machine.
I have also try eclipse.
My goal is to change a small passage of a binding.
IntelliJ: I go to File - Open and use pom.xml. At first I will only try if I can create the .jar file before I change the code. When I go to Build - Build Project I get this error:
Error:java: error: release version 5 not supported
I have installed the zulu 8 jdk
In eclipse the same. I open the project, go to File - Export and JAR file. Here I use all files in org.openhab.binding.emby, and chose this options:
JAR export finished with warnings. See details for additional information.
Exported with compile errors: org.openhab.binding.emby/src/main/java/org/openhab/binding/emby/internal/EmbyBindingConstants.java
Exported with compile errors: org.openhab.binding.emby/src/main/java/org/openhab/binding/emby/internal/EmbyHandlerFactory.java
Exported with compile errors: org.openhab.binding.emby/src/main/java/org/openhab/binding/emby/internal/discovery/EmbyClientDiscoveryService.java
Exported with compile errors: org.openhab.binding.emby/src/main/java/org/openhab/binding/emby/internal/discovery/EmbyDiscoveryService.java
Exported with compile errors: org.openhab.binding.emby/src/main/java/org/openhab/binding/emby/internal/handler/EmbyDeviceHandler.java
Exported with compile errors: org.openhab.binding.emby/src/main/java/org/openhab/binding/emby/internal/handler/EmbyBridgeHandler.java
Exported with compile errors: org.openhab.binding.emby/src/main/java/org/openhab/binding/emby/internal/model/embyPlayState.java
Exported with compile errors: org.openhab.binding.emby/src/main/java/org/openhab/binding/emby/internal/model/EmbyPlayStateModel.java
Exported with compile errors: org.openhab.binding.emby/src/main/java/org/openhab/binding/emby/internal/model/EmbyPlayingPostJsonModel.java
Exported with compile errors: org.openhab.binding.emby/src/main/java/org/openhab/binding/emby/internal/model/nowPlayingItem.java
Exported with compile errors: org.openhab.binding.emby/src/main/java/org/openhab/binding/emby/internal/protocol/EmbyConnection.java
Exported with compile errors: org.openhab.binding.emby/src/main/java/org/openhab/binding/emby/internal/protocol/EmbyClientSocket.java
Exported with compile errors: org.openhab.binding.emby/src/main/java/org/openhab/binding/emby/internal/protocol/EmbyDeviceEncoder.java
Exported with compile errors: org.openhab.binding.emby/src/main/java/org/openhab/binding/emby/internal/protocol/EmbyHTTPUtils.java
I think I forgot to load anything. Does someone can help me to export the jar file?
@rossgb: Thank you for your great tutorial. I have set this, but IntelliJ search a parent POM
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.openhab.addons.bundles:org.openhab.binding.emby:2.5.0-SNAPSHOT: Could not find artifact org.openhab.addons.bundles:org.openhab.addons.reactor.bundles:pom:2.5.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 11
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.openhab.addons.bundles:org.openhab.binding.emby:2.5.0-SNAPSHOT (D:\Profil\Downloads\openHAB-EMBY-master\openHAB-EMBY-master\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.openhab.addons.bundles:org.openhab.binding.emby:2.5.0-SNAPSHOT: Could not find artifact org.openhab.addons.bundles:org.openhab.addons.reactor.bundles:pom:2.5.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 11 -> [Help 2]
[ERROR]
Someone with a better grasp on the build system may be able to help you with a more elegant solution when you are not working with a full fork of openhab-addons.
By a “full fork” I just meant that you can create a new binding project by forking the entire openhab-addons repo and write your binding in-place (as I told you to re-create in my previous post). This makes building easier as maven can find parent POMs by just looking at parent directories.
In this openHAB-EMBY project only the binding itself is checked into the git repo. This means maven needs to go looking elsewhere for parent POMs.
I’m sure there are some arguments you can pass to maven to tell it to look somewhere else in the filesystem or in a maven repository but I’ve not tried that before so I just told you the way I know works.
Sorry I have an additional question. Givs an option in IntelliJ do cleanup the folder?
After I generate the jar file, I have many files like .importorder, .prefs or two times the thing-types.xml (one in target, classes, ESH-INF, thing
and one in src, main, ressources, ESH-INF, thing
Or givs some folder where I can delete after generate?