Groovy Script - unable to resolve class groovy.json.JsonSlurper

Hello, I’m new to programming in openHab 3.0 enviroment, and I need help to resolve this problem.
I try to create a groovy script that use a groovy class groovy.json.JsonSlurper, i paste the sample code here.

import groovy.json.JsonSlurper
def jsonSlurper = new JsonSlurper()
def object = jsonSlurper.parseText('{ "name": "John Doe" } /* some comment */')

assert object instanceof Map
assert == 'John Doe'

When I run it in the log console I get this errore message:

Script43.groovy: 1: unable to resolve class groovy.json.JsonSlurper

How can I install this Groovy package?

1 Like

Just hit this too!!! :frowning:

A pretty vital class for doing things. You find anything?

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.