Get your own Java server
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    try {
      Scanner myReader = new Scanner(new File("missing.txt"));
      myReader.close();
    } catch (FileNotFoundException e) {
      System.out.println("Error: the file was not found.");
    }
  }
}

              
Error: the file was not found.