我刚刚开始在Intellij中编辑我已经工作的groovy脚本,并且正在运行有线问题。我找不到使用谷歌的解决方案。
我有以下代码:
@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"
}
}
当我在命令行中运行它时,它可以工作。在Intellij中先按下 CTRL + Shift + F9以及之后的CTRL + Shift + F10我收到以下错误:
java.lang.ExceptionInInitializerError Caused by:
java.lang.RuntimeException: No suitable ClassLoader found for grab
我还尝试添加@GrabConfig(systemClassLoader = true),因为它在其他帖子中建议,但结果保持不变。 可能是什么问题?