Servelt类报错急求解决方案

我的MyEclipse for spring一旦把jdk换成1.8的创建一个Servelt的类就会报下面的错1.6的无法读到数据库的错

The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files

解决方法: 右击工程------》properties---》java bulid path----》libraries----》add library----》jre system library--》 workspace defalult JRE 选上,finsh,之后应该看到libraries下多了系统自带的jdk,然后ok,就ok了