我正在尝试在我的项目中使用 j2html 库,但我不断收到此编译错误。
Java版本:1.7
Grails 版本:2.4.3
Gradle 依赖添加:compile 'com.j2html:j2html:1.2.0'
进口:
import j2html.tags.ContainerTag
import static j2html.TagCreator.*
错误:
[groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
[groovyc] General error during semantic analysis: java.lang.NoClassDefFoundError: Unable to load class j2html.TagCreator due to missing dependency java/util/function/Predicate
[groovyc]
[groovyc] java.lang.RuntimeException: java.lang.NoClassDefFoundError: Unable to load class j2html.TagCreator due to missing dependency java/util/function/Predicate
[groovyc] at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1083)
[groovyc] at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1061)
[groovyc] at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:583)
[groovyc] at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:561)
[groovyc] at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:538)
[groovyc] at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:517)
[groovyc] at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:59)
[groovyc] at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:215)
[groovyc] at org.codehaus.groovy.ant.Groovyc.runCompiler(Groovyc.java:1161)
[groovyc] at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:1212)
[groovyc] at org.codehaus.groovy.grails.compiler.Grailsc.compile(Grailsc.java:78)
[groovyc] at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:827)
[groovyc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[groovyc] at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
[groovyc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[groovyc] at java.lang.reflect.Method.invoke(Method.java:606)
我该如何解决这个问题?