You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Dimitar Vassilev <di...@gmail.com> on 2016/12/05 12:48:54 UTC

snakeyaml import question for groovy 2.4.7 on Ubuntu 16.04 and RHEL 6.6

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.

Re: snakeyaml import question for groovy 2.4.7 on Ubuntu 16.04 and RHEL 6.6

Posted by Paul King <pa...@asert.com.au>.
You could also use a @Grab statement giving the appropriate URL.

On Tue, Dec 6, 2016 at 12:02 AM, Dimitar Vassilev
<di...@gmail.com> 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 <di...@gmail.com>:
>>
>> 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.
>>
>

Re: snakeyaml import question for groovy 2.4.7 on Ubuntu 16.04 and RHEL 6.6

Posted by Dimitar Vassilev <di...@gmail.com>.
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 <di...@gmail.com>:

> 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.
>
>