3

I'm just starting to edit my (already working) groovy scripts in Intellij and am running in a wired problem. I could not find a solution using google.

I have the following code:

@Grapes([
@Grab('org.codehaus.groovy.modules.http-builder:http-builder:+'),
@Grab('log4j:log4j:1.2.17'),
@Grab(group='com.sun.jersey', module='jersey-client', version='1.9.1'),
@Grab(group='com.sun.jersey', module='jersey-core', version='1.9.1'),
@Grab(group='com.sun.jersey.contribs', module='jersey-multipart', version='1.8'),
])

@Log4j
class DevTest{

    static void main(String[] args) {
          println "TEST"
    }
}

When I run it in the commandline it works. In Intellij pressing first CTRL+Shift+F9 and afterwards CTRL+Shift+F10 I get the following error:

java.lang.ExceptionInInitializerError Caused by:
java.lang.RuntimeException: No suitable ClassLoader found for grab

I also tried to add @GrabConfig( systemClassLoader=true ) as it was suggested in other posts, however the result stayed the same. What could be the problem?

user1587852
  • 1,567
  • 2
  • 11
  • 15
  • Possible duplicate of [No suitable classloader found for grab](https://stackoverflow.com/questions/4611230/no-suitable-classloader-found-for-grab) – krock Jun 11 '17 at 00:13

0 Answers0