I'm trying to make a background app in java, which will change my philips hue bulb's color depending on which button I press. I made a javascript code which succesfuly change it's color. I also made a part of program responsible for logging keyboard activity in java. And now there is a problem. How to execute js file from java?
I tried to use Nashorn script engine, but it can not recognize "const";
Draal : require function isn't defined.
Is there any way to solve this problem? I would be grateful if the answers were simple and understandable.
Using maven project
JDK 17
Vs code
node hue api - to control.
lights
jnativehook - library and.
examples to logging.
keyboard activity
If you need to see js file or background keylistener code I can post it here.
I followed examples from the Internet