The AEM Groovy Console provides an interface for running Groovy scripts in the AEM container. Scripts can be created to manipulate content in the JCR, call OSGi services, or execute arbitrary code using the CQ, Sling, or JCR APIs.
AEM 6.5 supports Java 11 but it seems the Groovy bundle is not working with this. Probably, a new version helps.
I tried with Groovy Console 16.
at java.base/jdk.internal.misc.Unsafe.defineClass0(Native Method) at java.base/jdk.internal.misc.Unsafe.defineClass(Unsafe.java:1194) at java.base/jdk.internal.reflect.ClassDefiner.defineClass(ClassDefiner.java:63) at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:400) at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:394) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/jdk.internal.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:393) at java.base/jdk.internal.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:92) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:55) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at java.base/java.lang.Class.newInstance(Class.java:584) at groovyjarjarantlr.ASTFactory.create(ASTFactory.java:262) [groovy-all:2.4.15] at groovyjarjarantlr.ASTFactory.create(ASTFactory.java:153) [groovy-all:2.4.15] at groovyjarjarantlr.ASTFactory.create(ASTFactory.java:194) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.namePart(GroovyRecognizer.java:11914) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.pathElement(GroovyRecognizer.java:11612) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.pathExpression(GroovyRecognizer.java:11757) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.postfixExpression(GroovyRecognizer.java:13470) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.unaryExpressionNotPlusMinus(GroovyRecognizer.java:13439) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.powerExpressionNotPlusMinus(GroovyRecognizer.java:13143) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.multiplicativeExpression(GroovyRecognizer.java:13075) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.additiveExpression(GroovyRecognizer.java:12745) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.shiftExpression(GroovyRecognizer.java:9981) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.relationalExpression(GroovyRecognizer.java:12650) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.equalityExpression(GroovyRecognizer.java:12574) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.regexExpression(GroovyRecognizer.java:12522) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.andExpression(GroovyRecognizer.java:12490) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.exclusiveOrExpression(GroovyRecognizer.java:12458) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.inclusiveOrExpression(GroovyRecognizer.java:12426) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.logicalAndExpression(GroovyRecognizer.java:12394) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.logicalOrExpression(GroovyRecognizer.java:12362) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.conditionalExpression(GroovyRecognizer.java:4955) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.assignmentExpression(GroovyRecognizer.java:8131) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.expression(GroovyRecognizer.java:10121) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.expressionStatementNoCheck(GroovyRecognizer.java:8458) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.expressionStatement(GroovyRecognizer.java:9004) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.statement(GroovyRecognizer.java:1276) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.compilationUnit(GroovyRecognizer.java:666) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:214) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:191) [groovy-all:2.4.15] at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:233) [groovy-all:2.4.15] at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:189) [groovy-all:2.4.15] at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:966) [groovy-all:2.4.15] at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:626) [groovy-all:2.4.15] at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:602) [groovy-all:2.4.15] at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579) [groovy-all:2.4.15] at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:323) [groovy-all:2.4.15] at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:293) [groovy-all:2.4.15] at groovy.lang.GroovyShell.parseClass(GroovyShell.java:677) [groovy-all:2.4.15] at groovy.lang.GroovyShell.parse(GroovyShell.java:689) [groovy-all:2.4.15] at groovy.lang.GroovyShell.parse(GroovyShell.java:725) [groovy-all:2.4.15] at groovy.lang.GroovyShell.parse(GroovyShell.java:716) [groovy-all:2.4.15] at groovy.lang.GroovyShell$parse.call(Unknown Source) [groovy-all:2.4.15] at com.icfolson.aem.groovy.console.impl.DefaultGroovyConsoleService.runScript(DefaultGroovyConsoleService.groovy:79) [aem-groovy-console:16.0.0]
AEM 6.5 supports Java 11 but it seems the Groovy bundle is not working with this. Probably, a new version helps. I tried with Groovy Console 16.
at java.base/jdk.internal.misc.Unsafe.defineClass0(Native Method) at java.base/jdk.internal.misc.Unsafe.defineClass(Unsafe.java:1194) at java.base/jdk.internal.reflect.ClassDefiner.defineClass(ClassDefiner.java:63) at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:400) at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:394) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/jdk.internal.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:393) at java.base/jdk.internal.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:92) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:55) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at java.base/java.lang.Class.newInstance(Class.java:584) at groovyjarjarantlr.ASTFactory.create(ASTFactory.java:262) [groovy-all:2.4.15] at groovyjarjarantlr.ASTFactory.create(ASTFactory.java:153) [groovy-all:2.4.15] at groovyjarjarantlr.ASTFactory.create(ASTFactory.java:194) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.namePart(GroovyRecognizer.java:11914) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.pathElement(GroovyRecognizer.java:11612) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.pathExpression(GroovyRecognizer.java:11757) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.postfixExpression(GroovyRecognizer.java:13470) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.unaryExpressionNotPlusMinus(GroovyRecognizer.java:13439) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.powerExpressionNotPlusMinus(GroovyRecognizer.java:13143) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.multiplicativeExpression(GroovyRecognizer.java:13075) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.additiveExpression(GroovyRecognizer.java:12745) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.shiftExpression(GroovyRecognizer.java:9981) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.relationalExpression(GroovyRecognizer.java:12650) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.equalityExpression(GroovyRecognizer.java:12574) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.regexExpression(GroovyRecognizer.java:12522) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.andExpression(GroovyRecognizer.java:12490) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.exclusiveOrExpression(GroovyRecognizer.java:12458) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.inclusiveOrExpression(GroovyRecognizer.java:12426) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.logicalAndExpression(GroovyRecognizer.java:12394) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.logicalOrExpression(GroovyRecognizer.java:12362) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.conditionalExpression(GroovyRecognizer.java:4955) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.assignmentExpression(GroovyRecognizer.java:8131) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.expression(GroovyRecognizer.java:10121) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.expressionStatementNoCheck(GroovyRecognizer.java:8458) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.expressionStatement(GroovyRecognizer.java:9004) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.statement(GroovyRecognizer.java:1276) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.parser.GroovyRecognizer.compilationUnit(GroovyRecognizer.java:666) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:214) [groovy-all:2.4.15] at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:191) [groovy-all:2.4.15] at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:233) [groovy-all:2.4.15] at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:189) [groovy-all:2.4.15] at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:966) [groovy-all:2.4.15] at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:626) [groovy-all:2.4.15] at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:602) [groovy-all:2.4.15] at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579) [groovy-all:2.4.15] at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:323) [groovy-all:2.4.15] at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:293) [groovy-all:2.4.15] at groovy.lang.GroovyShell.parseClass(GroovyShell.java:677) [groovy-all:2.4.15] at groovy.lang.GroovyShell.parse(GroovyShell.java:689) [groovy-all:2.4.15] at groovy.lang.GroovyShell.parse(GroovyShell.java:725) [groovy-all:2.4.15] at groovy.lang.GroovyShell.parse(GroovyShell.java:716) [groovy-all:2.4.15] at groovy.lang.GroovyShell$parse.call(Unknown Source) [groovy-all:2.4.15] at com.icfolson.aem.groovy.console.impl.DefaultGroovyConsoleService.runScript(DefaultGroovyConsoleService.groovy:79) [aem-groovy-console:16.0.0]