title: Stream cannot be resolved to a type
body: <p>I'm trying to write a script that looks at all the files in a given directory, takes each of their paths, and prints it to screen. Whenever I run my program it says stream cannot be resolved to a type. I know the error has something to do with my variable type but I do not know what to change my variable type to. Any help is appreciated.</p>
  <p>My Code:</p>
  <pre><code>import java.nio.file.Paths;
  import java.nio.file.Path;
  import java.nio.file.Files;
  import java.nio.stream.Stream;
  
  class FileFinder{
      
  
      public void getFiles(){
          Path path = Paths.get(&quot;C:/Users/MYNAME/Documents/TestFiles&quot;);
          
          Stream&lt;Path&gt; subPaths = Files.walk(path);
          subPaths.forEach(System.out::println);
  
      }
  }
  </code></pre>
  <p>Error Message:</p>
  <pre><code>Exception in thread &quot;getFiles&quot; java.lang.Error: Unresolved compilation problem: 
          Stream cannot be resolved to a type
  
          at FileFinder.getFiles(FileFinder.java:12)
  </code></pre>