Results 1 to 3 of 3
  1. #1
    mew
    mew is offline Member
    Join Date
    Nov 2007
    Posts
    70
    Rep Power
    0

    Default Unresolved compilation problem

    Following piece of code is not compiling.

    Java Code:
    File testFile = new File("C:\Temp\blah.txt");
    Exception:

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

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    Going to need to see some more code there champ, that piece of code you posted looks good to me. "...blah.txt" doesn't need to exist for that line to compile, so your error is elsewhere. For example:

    Java Code:
        
     File testFile = new File("/home/captainmorgan/Desktop/testfile.txt");
        try {
          System.out.println("Successfully created on the desktop: " + testFile.createNewFile());
        } catch (java.io.IOException ioE) {
          System.out.println("Exception thrown biatch");
        }
    does just what I intended by creating the new file, so that line of code you have is currently and at this point irrelevant. And that error message you're getting is a little vague without seeing more code.

  3. #3
    AralX is offline Member
    Join Date
    Dec 2007
    Location
    KSA, Riyadh
    Posts
    9
    Rep Power
    0

    Default

    ummm. the Error is
    "Exception in thread "main" java.lang.Error: Unresolved compilation problem:"
    are u sure it is the line that isn't compiled ?
    did try to handle "Security,FormatterClosed,FileNotFound"Excepti ons ? cause once my compiler wouldn't compile till I full handle the main exceptions.

    and do what C.Morgan told you

Similar Threads

  1. Unresolved compilation problem
    By mew in forum New To Java
    Replies: 3
    Last Post: 12-11-2007, 11:49 AM
  2. compilation error with Jcreator
    By Heather in forum JCreator
    Replies: 2
    Last Post: 06-30-2007, 04:12 PM
  3. compilation issue
    By orchid in forum Eclipse
    Replies: 2
    Last Post: 04-20-2007, 12:51 AM

Posting Permissions

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