问题描述
安装JDK9后,在运行Scala项目时出现此异常.将Scala升级到2.12.2并不能解决我的问题.
After installing JDK9, I get this exception when running my Scala projects. Upgrading Scala to 2.12.2 also didn't resolve my problem.
推荐答案
在模块路径上运行代码时,默认情况下不会解析java.xml.bind
模块.这意味着,如果您依赖JAXB,则需要使用--add-modules java.xml.bind
运行,或者在类路径(或模块路径)上部署JAXB.
The java.xml.bind
module is not resolved by default when running code on the module path. This means that if you depend on JAXB then you need to run with --add-modules java.xml.bind
or else deploy JAXB on the class path (or module path).
更新:"与Java EE共享的模块默认情况下无法解析"部分,"JDK 9迁移指南"提供了有关此主题的更多信息.
Update: The "Modules Shared with Java EE Not Resolved by Default" section of JDK 9 Migration Guide provides more information on this topic.
这篇关于java.lang.NoClassDefFoundError:javax/xml/bind/DatatypeConverter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!