问题描述

myeclipse2018编译时报 the method setTextContent() is undefined for the type Element,如下图所示

MyEclipse 下 the method setTextContent() is undefined for the type Element错误

解决方案

在Order and Export中点击up按钮,把jdk的顺序调整到最上面,如图1-1、1-2所示

MyEclipse 下 the method setTextContent() is undefined for the type Element错误

                                                      图1-1 调整前

MyEclipse 下 the method setTextContent() is undefined for the type Element错误

                                                        图1-2调整后

解释说明

jdk与xml-apis.jar都有org.w3c.dom.Element类,myeclipse会默认加载Order and Export中顺序靠前的jar里面的。由于xml-apis.jar中的Element没有此方法,所以会报错。


 

相关文章: