简体   繁体   English

错误:无法解析导入 java.nio.file.Files

[英]Error: The import java.nio.file.Files cannot be resolved

Java newbie here, Java新手在这里,

Using jdk1.8.0_05, I seem to be unable to resolve the java.nio.file.Files class使用jdk1.8.0_05,好像无法解析java.nio.file.Files类

import java.nio.file.Files;

with the following error:出现以下错误:

The import java.nio.file.Files cannot be resolved导入 java.nio.file.Files 无法解析

All other java.nio.file.* Classes (Path, Paths, FileSystem, etc.) seem to resolve just fine.所有其他 java.nio.file.* 类(路径、路径、文件系统等)似乎都可以很好地解析。 Based on other answers I've made sure of the following:根据其他答案,我确定了以下几点:

  1. Java build path set to JRE System Library jre8 for the project项目的 Java 构建路径设置为 JRE 系统库 jre8
  2. Set workspace compiler compliance level to 1.7, as high as it goes将工作区编译器合规性级别设置为 1.7,尽可能高

I'm using eclipse 3.7.2.我正在使用 Eclipse 3.7.2。

Thanks for the help谢谢您的帮助

This is definitely something to do with the version of eclipse (3.7.2) that I was using.这绝对与我使用的 eclipse (3.7.2) 版本有关。 Someone gave me their copy of android developer tools and the problem went away.有人给了我他们的 android 开发者工具副本,问题就解决了。

So... Update your eclipse if you see this.所以......如果你看到这个,请更新你的日食。

Files cannot be resolved文件无法解析
Paths cannot be resolved路径无法解析

FIX :使固定 :

import java.nio.file.*;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM