Results 1 to 3 of 3
  1. #1
    jcen is offline Member
    Join Date
    Sep 2010
    Posts
    2
    Rep Power
    0

    Default Exception in thread "main" java.lang.Error: Unresolved compilation problem

    Hi, I am simply trying to test a scanner, but I keep getting an error. I want to print the first line of text from the file. I'm new to Java.

    I'm guessing it has something to do with my path--but I have no idea what to do. I tried an absolute path. Nada. I'm using eclipse. Here's my code.

    SO FRUSTRATING!

    public static void main(String[] args) {

    Scanner fileIn = new Scanner(new FileReader("blah.txt"));
    String testOut = fileIn.nextLine();
    System.out.println(testOut);
    fileIn.close();
    }

  2. #2
    jcen is offline Member
    Join Date
    Sep 2010
    Posts
    2
    Rep Power
    0

    Default

    Nevermind. Imported and added a throw.

  3. #3
    shaminder is offline Member
    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0

    Default Re: Exception in thread "main" java.lang.Error: Unresolved compilation problem

    hey jcen...
    same problem i m getting to run my java file. if u got the solution for this.. please help me too...

    thanx....
    shaminder....

Similar Threads

  1. Replies: 5
    Last Post: 06-22-2010, 03:51 PM
  2. Replies: 8
    Last Post: 02-23-2010, 12:22 PM
  3. Replies: 1
    Last Post: 11-20-2009, 07:58 PM
  4. Replies: 1
    Last Post: 08-07-2007, 07:10 AM
  5. Replies: 1
    Last Post: 07-25-2007, 10:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •