The type java.lang.AutoCloseable cannot be resolved. It is indirectly referenced from required .class files
出现问题:
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的更多相关文章
- 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 ...
- 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 ...
- 部署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 ...
- 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 ...
- 问题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 ...
- 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 ...
- 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 ...
- 当你在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,导致了出现了差错!
- 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 ...
随机推荐
- Nacos(八):Nacos持久化
参考和感谢 Spring Cloud Alibaba基础教程:Nacos的数据持久化 前言 前景回顾: Nacos(七):Nacos共享配置 Nacos(六):多环境下如何"管理" ...
- unity_实用小技巧(空指针错误)
在游戏开发中,空指针错误是我们最常见也是最容易出现的错误.下面介绍一下博主近期遇见的空指针错误 如上图,有两个类,如果此时我们在图2中调用图1的单例模式可能会出现空指针错误. 原因在于:编译器可能先执 ...
- Leetcode之深度优先搜索(DFS)专题-559. N叉树的最大深度(Maximum Depth of N-ary Tree)
Leetcode之深度优先搜索(DFS)专题-559. N叉树的最大深度(Maximum Depth of N-ary Tree) 深度优先搜索的解题详细介绍,点击 给定一个 N 叉树,找到其最大深度 ...
- atcoder D - 11(组合数学)
题目链接:http://arc077.contest.atcoder.jp/tasks/arc077_b 题解:有n+1个数只有一个数字是有重复出现的,要求一共有多少不同的组合显然和这两个数的位置有关 ...
- Fractions Again?! UVA - 10976
It is easy to see that for every fraction in the form 1k(k > 0), we can always find two positive ...
- 一台Linux服务器可以负载多少个连接?
首先我们来看如何标识一个TCP连接?系统是通过一个四元组来识别,(src_ip,src_port,dst_ip,dst_port)即源IP.源端口.目标IP.目标端口.比如我们有一台服务192.168 ...
- JXOI 2017 颜色 题解
T3 颜色 100/100 对于这题由于数据范围小,有一种神奇的做法,我们可以把每个值随机赋值,但是保证相同颜色的和为0,就代表消去了这个颜色,我们只要取寻找合法区间就行,合法区间的寻找只要找相同前缀 ...
- yzoj1985 最长公共单调上升子序列 题解
题面给两个序列a,b长度分别为n,m求最长公共上升子序列,百度了一下求公共子序列的问题好像叫做LCS,而上升的叫做LCIS.都是dp的例题. 先来说说最长公共子序列,这是一道比较经典的dp题,我们可以 ...
- 在javascript中的浏览器兼容问题以及兼容浏览器汇总(默认事件,阻止冒泡,事件监听。。。)以及解决方式详解
在javascript中常见的浏览器兼容问题,以及解决方式. 在前端工作当中我们遵循这样的原则:渐进增强和优雅降级 渐进增强(progressive enhancement): 针对低版本浏览器进 ...
- 通过Service访问应用 (1)
目录 通过Service访问应用 通过Pod IP访问应用 通过ClusterIP Service在集群内部访问 通过Service访问应用 通过之前的操作,应用部署完成了,我们的Demo网站已 ...