You could also use a @Grab statement giving the appropriate URL.
On Tue, Dec 6, 2016 at 12:02 AM, Dimitar Vassilev <[email protected]> wrote: > For the record - the problem is solved by either copying the snakeyaml jar > to lib/groovy directory or specifying the JAVA_CLASSPATH > > 2016-12-05 14:48 GMT+02:00 Dimitar Vassilev <[email protected]>: >> >> Hello, >> can someone advise how to import properly snakeyaml into groovy 2.4.7? >> I've tried on Ubuntu 16.04 and RHEL 6.6 by invoking it from groovysh or >> groovy directly >> >> groovy:000> import org.yaml.snakeyaml.Yaml; >> Invalid import definition: 'org.yaml.snakeyaml.Yaml'; reason: startup >> failed: >> script14809411869301863038523.groovy: 1: unable to resolve class >> org.yaml.snakeyaml.Yaml >> @ line 1, column 1. >> import org.yaml.snakeyaml.Yaml; >> ^ >> >> 1 error >> >> However if I load import org.yaml.snakeyaml.* it succeeds, but later on >> when I try to find what classes have been imported I have no luck. >> >> The error persists both on the binary distribution from groovy/ubuntu web >> sites and the one installed via sdkman (RHEL). JDKs I've used are openjdk >> and the Oracle JDK 8u111. >> Many thanks for your help. >> >
