the codes running ok on NetBeans, and wih the error messages while I am running the jar file. Any helps with the following code would be very appreciated.

Scanner file = null;

while(file.hasNext()){
          if (file.hasNextInt()) list.add(file.nextInt());
              else file.next();
      }