gpt4 book ai didi

java - ElementNSImpl 无法在带有 Java Zulu 11 的 Eclipse 中工作

转载 作者:行者123 更新时间:2023-12-02 09:55:05 27 4
gpt4 key购买 nike

编辑

我尝试执行gradle build,但它给了我这个错误:

package com.sun.org.apache.xerces.internal.dom is declared in module java.xml, which does not export it

我检查了gradle依赖项,但没有人使用java.xml

<小时/>

我们仅在代码的一部分中使用 ElementNSImpl(我不知道为什么......)。不管怎样,当我尝试切换到 Java 11 Zulu 时,Eclipse 给了我这个错误:

The type com.sun.org.apache.xerces.internal.dom.ElementNSImpl is not accessible

对于 OpenJDK 8,我们必须使用 xerces:xercesImpl:2.6.2-jaxb-1.0.6 导入它

我用 Eclipse 检查了该类,它是一个公共(public)类,位于 Zulu 11 jar 下。

最佳答案

正如@Holger 在 its comment 中所说@AlanBateman 在 its comment 中说道, com.sun.org.apache.xerces.internal.dom是 JDK 内部的。您只需替换 com.sun.org.apache.xerces.internal.dom.ElementNSImplorg.w3c.dom.Element

关于java - ElementNSImpl 无法在带有 Java Zulu 11 的 Eclipse 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56061693/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com