概述
以以下这段代码为例
@Grab('org.jsoup:jsoup:1.10.1')
import org.jsoup.Jsoup
Jsoup.connect('https://v2ex.com').get()
.select('span.item_title > a').each {
println it.text() + ':' + 'https://v2ex.com' + it.attr('href')
}
原本是 groovy2.5+java8,可以正常跑,然后我前两天格盘重装了 mojave,直接上了 Java10,就不行了,报以下错
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/usr/local/Cellar/groovy/2.5.0/libexec/lib/groovy-2.5.0.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Caught: java.lang.NoClassDefFoundError: Unable to load class groovy.xml.jaxb.JaxbGroovyMethods due to missing dependency javax/xml/bind/Unmarshaller
java.lang.NoClassDefFoundError: Unable to load class groovy.xml.jaxb.JaxbGroovyMethods due to missing dependency javax/xml/bind/Unmarshaller
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)
谷歌,爆栈网都翻了一番,还是没有找到解决方法,哪位大佬指点迷津?
最后
以上就是激昂山水为你收集整理的java+groovy+计算错误_Java9+移除 Java EE,导致我的 groovy 脚本无法运行的全部内容,希望文章能够帮你解决java+groovy+计算错误_Java9+移除 Java EE,导致我的 groovy 脚本无法运行所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复