Results 1 to 3 of 3
  1. #1
    Sparky is offline Member
    Join Date
    Jan 2011
    Posts
    32
    Rep Power
    0

    Default error - I think involving my Import Statements

    Greetings,

    Can you help resolve this:

    My statement giving me a problem is:

    Document doc = parser.build(http://......);

    I get 2 different errors depending upon my Import statements:

    (all of this is code from a tutorial - )

    The tutorial has:
    Java Code:
    import org.jdom.JDOMException;
    import org.jdom.input.SAXBuilder;
    import java.io.IOException;
    With just these 3 lines (of import statements) the error on the Document line is:

    Cannot find symbol
    Symbol class Document
    Location


    I added
    Java Code:
    Import org.w3c.dom.Document
    and I get a different error:

    Incompatible types
    required: org.w3c.dom.Document
    found: org.jdom.Document


    Again the tutorial only has the 3 original import statements.

    Thanks
    -Sparky

  2. #2
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    You need add library in classpath.
    Skype: petrarsentev
    http://TrackStudio.com

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,935
    Rep Power
    19

    Default

    "org.jdom.Document"

    That's the Document class that JDOM uses, so import that, not the w3c one.

    ETA: No, this error is not to do with missing libraries, but incompatible types.

Similar Threads

  1. Import error for csv file in outlook
    By nida in forum New To Java
    Replies: 5
    Last Post: 09-07-2012, 01:22 AM
  2. Error involving DecimalFormat
    By kamikaze in forum New To Java
    Replies: 4
    Last Post: 10-18-2010, 02:04 AM
  3. error with import java.io.*
    By osval in forum New To Java
    Replies: 5
    Last Post: 05-13-2010, 05:03 PM
  4. import error
    By amarenash23 in forum New To Java
    Replies: 2
    Last Post: 01-15-2010, 11:32 AM
  5. Problems with packages (import statements)
    By ai_2007 in forum Advanced Java
    Replies: 1
    Last Post: 06-29-2007, 11:57 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
  •