出现问题:

The type java.lang.AutoCloseable cannot be resolved. It is indirectly referenced from required .class files

原因:

这是一个“类型到java.lang.charsequence不能解决”的错误。这个主要是由于MyEclipse引用了不同版本的jdk工程印发的问题。我们都知道,每次新建一个工程时,MyEclipse都会让我们选择要使用的jdk版本,而我的电脑上有jdk1.6和jdk1.7和jdk1.9三个版本。所以当电脑上有多个版本的jdk时,开发环境会自动选择默认的Jre。所以我们通过以下的方案来解决这个错误:

解决方案:更换IDE或者更改JDK。

我提供一种解决方法:更换JDK版本。

具体操作:

1.按照这个路径进入:Window->preferences->java->Installed JREs:

  看到默认情况下,我IDE使用的是JDK1.6版本。

2.点击add,添加PC上的合适的jdk

3.找到PC安装jdk的目录(找自己的安装目录),选择一个不同的jdk即可--------不是选择jre.

4.添加之后,多一个,然后更换就决绝问题了。

The type java.lang.AutoCloseable cannot be resolved. It is indirectly referenced from required .class files的更多相关文章

  1. eclipse中java文件报错:The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

    问题:The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class fi ...

  2. The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files

    最近在做J2ME开发项目,配置环境一切OK,但是打开项目时某些文件提示: The type java.lang.String cannot be resolved. It is indirectly ...

  3. 部署hibernate框架项目时出现问题:The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files.

    基本情况: (这些其实关系不大)我是直接impor导入HibernateDemo项目到eclipse中的,该项目的hibernate版本是3.6.7.Final版,使用了Hibernate Tools ...

  4. The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

    The type java.lang.Object cannot be resolved.It is indirectly referenced from required .class files ...

  5. 问题1-The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files

    问题一:The type java.lang.String cannot be resolved. It is indirectly referenced from required .class f ...

  6. The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files.

    参照 http://stackoverflow.com/questions/24301986/the-type-java-lang-charsequence-cannot-be-resolved-in ...

  7. java报错:The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

    看包的路径是否对对:比如这样不对(...src/object/obietc) 其它解决方法转载: https://www.cnblogs.com/yadongliang/p/5918228.html ...

  8. 当你在web项目下新建一个class时package位置如果发生红色波浪错误,提示为”The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files“

    问题是这样的如下图: 问题的原因: 1.配置tomcat7.0的时候自己设置了jre的版本1.8,而没有用myeclipse10自带的jre1.6,导致了出现了差错!

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

    要解决的话,方法有两个 1)可以选用较低版本的sdk,比如我就用回1.6版本的sdk window->preferences->Java->Installed JREs->Ad ...

随机推荐

  1. windows的磁盘操作之七——获取当前所有的物理磁盘号 加备注

     windows的磁盘操作之七--获取当前所有的物理磁盘号 2011-07-28 17:47:56 标签:windows API DeviceIoControl 物理磁盘 驱动器号 原创作品,允许转载 ...

  2. MongoDB 数据库的学习与使用

    MongoDB 数据库 一.MongoDB 简介(了解) ​ MongoDB 数据库是一种 NOSQL 数据库,NOSQL 数据库不是这几年才有的,从数据库的初期发展就以及存在了 NOSQL 数据库. ...

  3. 设计模式(C#)——06桥接模式

    推荐阅读:  我的CSDN  我的博客园  QQ群:704621321       在早先,几乎每个手机的充电器接口都是不同的.每个型号的手机都有一个充电器,此时我们把充电器作为一个抽象类,抽象类中提 ...

  4. java.lang.Thread类详解

    java.lang.Thread类详解 一.前言 位于java.lang包下的Thread类是非常重要的线程类,它实现了Runnable接口,今天我们来学习一下Thread类,在学习Thread类之前 ...

  5. 微信小程序室内地图导航开发-微信小程序JS加载esmap地图

    一.在微信小程序里显示室内三维地图 需要满足的两个条件 调用ESMap室内地图需要用到小程序web-view组件,想要通过 web-view 调用ESMap室内地图需要满足以下 2 个条件: 1. 小 ...

  6. IT项目管理入门知识

  7. Kth Minimum Clique_2019牛客暑期多校训练营(第二场)

    题目连接: https://ac.nowcoder.com/acm/contest/882/D Description Given a vertex-weighted graph with N ver ...

  8. poj 2352 & Ural 1028 数星星 题解

    一道水题,由于x坐标递增y坐标也递增于是前缀和统计即可,用树状数组实现. #include<bits/stdc++.h> using namespace std; const int ma ...

  9. shell 菜单选择命令

    devices=`adb devices | sed '1d;$d' | sed 's/device//g'`         */sed '1d;$d' : 删除第一行和最后一行*/ device_ ...

  10. 实现一个基于码云Storage

    实现一个简单的基于码云(Gitee) 的 Storage Intro 上次在 asp.net core 从单机到集群 一文中提到存储还不支持分布式,并立了一个 flag 基于 github 或者 开源 ...