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 ...
随机推荐
- 玩转SpringBoot 2 快速搭建 | Spring Initializr 篇
SpringBoot 为我们提供了外网 Spring Initializr 网页版来帮助我们快速搭建 SpringBoot 项目,如果你不想用 IDEA 中的插件,这种方式也是不错的选择.闲话少说,直 ...
- Java 从入门到进阶之路(四)
之前的文章我们介绍了 Java 的运算符和表达式,本章我们来看一下 Java 的循环结构. 循环是程序设计语言中反复执行某些代码的一种计算机处理过程,是一组相同或相似语句被有规律的重复性进行. 循环的 ...
- Leetcode之回溯法专题-131. 分割回文串(Palindrome Partitioning)
Leetcode之回溯法专题-131. 分割回文串(Palindrome Partitioning) 给定一个字符串 s,将 s 分割成一些子串,使每个子串都是回文串. 返回 s 所有可能的分割方案. ...
- 【原创】ARMv8 MMU及Linux页表映射
背景 Read the fucking source code! --By 鲁迅 A picture is worth a thousand words. --By 高尔基 说明: Kernel版本: ...
- 深入理解vmware虚拟网络
0x01:vmware workstation VMware Workstation是一款非常不错的虚拟机软件,许多爱好者用VMware,Workstation设计多种实现环境做测试.VMware W ...
- Jenkins教程(三)添加凭据与流水线拉取Git代码
前言 本文旨在配置凭据.使用Git仓库中的Jenkinsfile与使用声明式流水线拉取Git代码 使用SVN等其他版本控制工具,请参考使用Pipeline-Syntax生成对应代码块 凭据(crede ...
- DEVOPS基础
转自:http://www.scrumcn.com/agile/scrum-knowledge-library/agile-development.html#tab-id-7 DevOps是一组过程. ...
- win8调出右侧菜单栏
1.快捷键:win+c 2.鼠标放在右下角1s
- ZOJ - 3870-Team Formation二进制,位运算
传送门:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3870 题意:找出一个数列中的两个数,所有通过异或和使得结果同时大于 ...
- AC自动机 数组实现
AC自动机的实现原理是KMP + 字典树. 学AC自动机之前要先去学KMP 和 字典树. 第一步先构建一个字典树. void Insert(){ , len = strlen(str); ; i &l ...