title: Reading file in java on Mac
body: <p>I am doing a tutorial on java and the video I am at now deals with FileReading, but it is for windows and I am on a mac. Please help</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import java.io.File;
  import java.io.FileNotFoundException;
  import java.util.Scanner;
  
  public class App {
  
   public static void main(String[] args) throws FileNotFoundException {
    String fileName = "/Users/--MyUsername--/Desktop/test.rtf";
    
    File textFile = new File(fileName);
    
    Scanner in = new Scanner(textFile);
    
    int value = in.nextInt();
    System.out.println("Read value: " + value);
    
    in.nextLine();
    
    int count = 2;
    
    while(in.hasNextLine()){
     String line = in.nextLine();
     
     System.out.println(count + ": " + line);
     count++;
    }
    
    in.close();
   }
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>and this is the error that I am getting</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>Exception in thread "main" java.util.InputMismatchException
   at java.util.Scanner.throwFor(Scanner.java:840)
   at java.util.Scanner.next(Scanner.java:1461)
   at java.util.Scanner.nextInt(Scanner.java:2091)
   at java.util.Scanner.nextInt(Scanner.java:2050)
   at L37ReadingTextFiles.App.main(App.java:17)</code></pre>
  </div>
  </div>
  </p>
  
  <p>Please help</p>