原因:项目buildpath不对

解决方案:

右键项目-------build path--------configuration build path

的选择libraries找到JRE(这个时候你会发现这个jre前面有!或者是红X)选中remove掉重新为该项目选择一个JRE选中项目

project----clean

 

The import org.apache cannot be resolved

What IDE are you using? If it's eclipse, right click on the project -> Build Path -> Configure Build Path -> Libraries -> Add External Jar's