The method getTextContent() is undefined ?

  In the evening after work, half the class to write code brought back. Home unexpectedly results back when the code introduced into the eclipse, the following line being given directly displayed getTextContent () is not defined.

         ((Element) ele.getElementsByTagName( "err_code").item(0 )).getTextContent();

       First thought was jdk version of the problem, it is impossible ah, I installed yesterday jdk 1.6.0_24, see the document jdk org.w3c.dom.Element, within its parent in interface org.w3c.dom.Node is getTextContent ( ) this method, odd strange. google a lot, only to find the project xml-apis.jar which also has a org.w3c.dom.Element, the actual call, java compiler uses this class, without jdk in the class uses. This truth to light.

 

        Solutions need to change about the order of java compiler compiler.

        The following is a screenshot of the eclipse and modify the description:       

         This is the lowest level in jre builder path, so the compiler does not use the JRE classes, then you need to adjust the location of the JRE online, select the check box next to, and then use the Up and Down button to the right (JRE already now the bottom, so the Down button is not available at this time) can adjust the position of the JRE. The location of the JRE transferred to the Web APP Library above ok. 



Guess you like

Origin www.cnblogs.com/Jeely/p/11100965.html