Unable to resolve class groovy.json.JsonSlurpe

Deepika Raj picture Deepika Raj · Aug 24, 2017 · Viewed 14.9k times · Source

I am getting the following error messages returned:

    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 

Answer

Rao picture Rao · Aug 24, 2017

Try changing the first line. Trivial typo.

From:

import groovy.json.JsonSlurpe

To:

import groovy.json.JsonSlurper