How would you import classes in a script runner groovy script?

Haani_Niyaz August 13, 2014

Normally you could just peform an

import someClassName

and the groovy script will import the class (assmuming its all in the current dir).

However, how would I accomplish this when the script is run via the groovy script runner?

1 answer

1 accepted

0 votes
Answer accepted
Alexey_Rjeutski__Polontech_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 14, 2014

what is the difference? the same way, in the beginning of the script. Doesn't it work for you? do you have some errors?

Haani_Niyaz August 17, 2014

I encounter something along the lines of

noMethodError

however if i use the class in the same file, it works.

Alexey_Rjeutski__Polontech_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 17, 2014

Please give more context and some non-working sample code

Haani_Niyaz August 18, 2014

Thanks for the assistance but it appears to be working now. I'm unsure what I did differently from the first time I tested it.

Suggest an answer

Log in or Sign up to answer