The method getTextContent() is undefined for the type Node解决方法(eclipse)

来源:互联网 发布:qq三国79js单刷孟获 编辑:程序博客网 时间:2024/06/08 12:53

前两天在使用org.w3c.dom.Node.getTextContent()出现了The method getTextContent() is undefined for the type Node的提示,

如下图:



产生的原因:

在j2ee项目中的xml-apis.jar下的org.w3c.dom干扰了Java的类查找,所以我们只需要把jdk的优先级调整到它之前就可以了。


解决方法:


在eclipse中对应项目中右击按照: build path--> configure build path进入path对应界面,如下图:




选择order and export,如下图:





将图中的jre system library选中,并点击top按钮,让jre排在最上面,如下图:




点击ok按钮,就可以了,现在看项目中就没出现错误提示了,如下图:




---------------------------------------------------------------------------版权声明------------------------------------------------------------------------------------------

版权声明:本文为博主原创文章,未经博主允许不得转载。博客地址:http://blog.csdn.net/mr_smile2014


3 0