Windows 10 OS, Java 9, Groovy 2.5.7 (newly upgraded)
I launch the Groovy Console, and run this
println "hello"
I get this exception
Exception thrown
java.lang.NoClassDefFoundError: Unable to load class org.apache.groovy.jaxb.extensions.JaxbExtensions due to missing dependency javax/xml/bind/JAXBContext
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
There's an answer here about this, though not Groovy-specific, even less Groovy-Console-specific.
I tried the following lines as line 1:
@Grab( "javax.xml.bind:jaxb-api:2.2.11" )
then
@Grab( "javax.xml.bind" )
... both of these gave
1 compilation error:
unexpected token: println at line: 3, column: 1
(i.e. the println
line)