Multiple markers at this line报错

Multiple markers at this line
- The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files
- The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files

Multiple markers at this line报错_第1张图片
当出现上图所示errors,原因大概是这样的:

  1. jdk版本太新,而eclipse版本比较旧,eclipse本身就是java开发的,所以eclipse的编译器使用的jdk版本没有程序的jdk版本高,造成一些误报。

  2. 要解决的话,方法有两个

    • 可以选用较低版本的jdk,比如我就用回1.7版本的jdk,window->preferences->Java->Installed JREs->Add 选择一个低版本的jdk目录
    • 下载一个最新的eclipse,与1.8版本的jdk匹配我用的第一种,因为我本机有低版本的jdk,这样代价低一点。

    我用回1.7版本的jdk后就解决问题了。
    Multiple markers at this line报错_第2张图片
    Multiple markers at this line报错_第3张图片

你可能感兴趣的:(java)