3

我收到以下错误消息:

    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script3.groovy: 1: unable to resolve class groovy.json.JsonSlurpe @ line 1, column 1. import groovy.json.JsonSlurpe ^ 
    org.codehaus.groovy.syntax.SyntaxException: unable to resolve class groovy.json.JsonSlurpe @ line 1, column 1. at 
    org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:149) at 
    org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1225) at 
    org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:178) at 
    org.codehaus.groovy.control.CompilationUnit$11.call(CompilationUnit.java:651) at 
    org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:931) at 
    org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593) at 
    org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:542) at 
4

2 回答 2

17

尝试更改第一行。琐碎的错字。

从:

import groovy.json.JsonSlurpe

至:

import groovy.json.JsonSlurper
于 2017-08-24T09:38:52.283 回答
0

你的第一行应该是这样的......

导入 net.sf.json.groovy.JsonSlurper

这对我有用。

于 2021-05-07T12:25:46.390 回答