我用的是MyBatis3.2.4的版本
首先将jar包解压,在MyBatis\org\apache\ibatis\builder\xml的文件夹中找到mybatis-3-config.dtd和mybatis-3-mapper.dtd两个文件,复制到myeclipse项目中,MyBatis为解压后的文件夹。在myeclipse中选择windows中preference,搜xml catalog ,选择xml catalog 。
在User Specified Entries下点击Add,在file System选择mapper的dtd,在项目中打开这个dtd复制其中的一句话,在头部,粘贴到key中
在User Specified Entries下点击Add,在file System选择config的dtd,在项目中打开这个dtd复制其中的一句话,在头部,粘贴到key中
然后点击ok.就行了。