Here\'s part of my code
try{ BufferedReader in= new BufferedReader(new InputStreamReader(System.in)); while ((line= in.readLine())!=\"exit\"){
Chances are you've just missed:
import java.io.File;
from the top of your source file.
You could use
import java.io.*;
I typically use single-type imports.