dvdgeisler / DirigeraClient

Dirigera Client API: Java written client API to interface IKEA's new smarthome hub DIRIGERA
MIT License
73 stars 9 forks source link

Beginners question - how to run the examples #99

Open zuffnick opened 6 months ago

zuffnick commented 6 months ago

Dear all, first of all many thanks for your great work! I just got a Dirigera Hub and some smart lights and would like to integrate them into openhab. I can do scripting, but I'm not familiar with java projects. To dive deeper into Dirigera I would like to run the provided examples. Unfortunately I'm stuck at this point and also google didn't help :(

I tried the jre from github and also built the project myself.

If I try to run the jar-file or a class I get the following error:

java -jar dirigera-client-examples.jar kein Hauptmanifestattribut, in dirigera-client-examples.jar

ava -jar dirigera-client-examples.jar Rooms kein Hauptmanifestattribut, in dirigera-client-examples.jar

Try running the class itself: java Rooms Fehler: Hauptklasse Rooms konnte nicht gefunden oder geladen werden Ursache: java.lang.NoClassDefFoundError: de/dvdgeisler/iot/dirigera/client/examples/rooms/Rooms (wrong name: Rooms)

My java version is: java --version openjdk 19.0.2 2023-01-17 OpenJDK Runtime Environment (build 19.0.2+7-Ubuntu-0ubuntu322.04) OpenJDK 64-Bit Server VM (build 19.0.2+7-Ubuntu-0ubuntu322.04, mixed mode, sharing)

What is wrong with my setup? I am grateful for any tips!

Thanks for your help!

Mike

TheMrBooyah commented 6 months ago

The person maintaining the repo hasn't really had any activity for a long time now. However, to answer your question: java -cp <jar file> <class Name>

e.g.: java -cp ~/Downloads/dirigera-client-examples.jar de.dvdgeisler.iot.dirigera.client.examples.rooms.Rooms

Replace de.dvdgeisler.iot.dirigera.client.examples.rooms.Rooms with whichever example you want to try out