原因:idea编辑器自动导入了如下的包 import com.sun.org.apache.xpath.internal.operations.String; 该包与java.lang.String包冲突了,所以会报错 删除该包的即可