4
votes

Java newbie here,

Using jdk1.8.0_05, I seem to be unable to resolve the java.nio.file.Files class

import java.nio.file.Files;

with the following error:

The import java.nio.file.Files cannot be resolved

All other java.nio.file.* Classes (Path, Paths, FileSystem, etc.) seem to resolve just fine. Based on other answers I've made sure of the following:

  1. Java build path set to JRE System Library jre8 for the project
  2. Set workspace compiler compliance level to 1.7, as high as it goes

I'm using eclipse 3.7.2.

Thanks for the help

2
Did you try to 'refresh' your project and then 'clean up'?indivisible
try to restart your IDE too.Marco Acierno
Sorry I'm new, do you mean file -> Refresh, then project -> Clean? I just tried that and nothing seems to have changed.... and tried the restart to no avail. Thanks though!TheHof
Are you sure that the "jre8" JRE points to a 1.8 (or 1.7) JRE? That class did exist before 1.7. And why such an old version of Eclipse?nitind
The only versions of the jre that are on my computer are 1.7 and 1.8, so I think I am good there. As for your other question, that is the eclipse version "approved" for our network.TheHof

2 Answers

4
votes

This is definitely something to do with the version of eclipse (3.7.2) that I was using. Someone gave me their copy of android developer tools and the problem went away.

So... Update your eclipse if you see this.

1
votes

Files cannot be resolved
Paths cannot be resolved

FIX :

import java.nio.file.*;