Openhab tutorial Jython JSR232 scripting issue

  • Platform information:
    • Hardware: Rasberry Pi 4

    • OS: Linux raspberrypi 5.4.83-v7l

    • Java Runtime Environment:
      openjdk version “” 2020-11-04
      OpenJDK Runtime Environment (build
      OpenJDK Server VM (build, mixed mode)

    • openHAB version: OH 3.0.0

  • Issue of the topic: Example Script throwing error in openhab.log file.
    Just to make sure things are running correctly, I decided to use the Jython example given at: JSR223 Scripting | openHAB

which is:


class myRule(SimpleRule):
def execute(self, module, inputs):
print “This is a ‘hello world!’ from Jython rule.”

sRule = myRule()
“cronExpression”: “0 * * * * ?”


  • In the log file openhab.log I get the following:

2021-01-07 23:48:11.769 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘b001e0ea15’ failed: :4:0 Expected an operand but found class
class myRule(SimpleRule):
^ in at line number 4 at column number 0

I’m not sure what I am doing wrong, any ideas?