Results 1 to 14 of 14
  1. #1
    Join Date
    Mar 2011
    Posts
    20
    Rep Power
    0

    Default how do i import other projekts??

    hey hey guys.... i have recently switch from Jedit to eclipse... and i wanna bring all my projekt with me... but when i do it and try to run them it says this :
    Exception in thread "main" java.lang.Error: Unresolved compilation problem:

    at stefan.DagTaeller.main(DagTaeller.java:2)

    anybody that knows what im doing wrong??

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    12,999
    Blog Entries
    7
    Rep Power
    19

    Default

    Quote Originally Posted by stefandanielsen View Post
    hey hey guys.... i have recently switch from Jedit to eclipse... and i wanna bring all my projekt with me... but when i do it and try to run them it says this :
    Exception in thread "main" java.lang.Error: Unresolved compilation problem:

    at stefan.DagTaeller.main(DagTaeller.java:2)

    anybody that knows what im doing wrong??
    Just as the error is trying to tell you: one of those classes can't be compiled without errors. Fix it, it's the DagTaeller class. The error happens to be in line 2 so I guess it can't find an imported class.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  5. #5
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    12,999
    Blog Entries
    7
    Rep Power
    19

    Default

    Quote Originally Posted by Eranga View Post
    That is nothing to do with import Jedit to Eclipse.
    The project structure may be incorrect (according to Eclipse) and maybe it can't find the imported class ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  6. #6
    Join Date
    Mar 2011
    Posts
    20
    Rep Power
    0

    Default

    my problem is that the files work perfektly in Jedit but when i import them to eclipse it says that there´s an error....

    so what am i forgetting??

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Quote Originally Posted by JosAH View Post
    The project structure may be incorrect (according to Eclipse) and maybe it can't find the imported class ...

    kind regards,

    Jos
    Oh yes, that could be. I've ever use Jedit and is it possible to import them into Eclipse without warning the incompatibility?

  8. #8
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    12,999
    Blog Entries
    7
    Rep Power
    19

    Default

    Quote Originally Posted by stefandanielsen View Post
    my problem is that the files work perfektly in Jedit but when i import them to eclipse it says that there´s an error....

    so what am i forgetting??
    Eclipse will tell you: there's probably a little red icon near that file; open it and check the offending line; hover your mouse over the error icon to see the error message and fix what is wrong.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  9. #9
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    12,999
    Blog Entries
    7
    Rep Power
    19

    Default

    Quote Originally Posted by Eranga View Post
    Oh yes, that could be. I've ever use Jedit and is it possible to import them into Eclipse without warning the incompatibility?
    I don't know because I've never use Jedit either but I'm pretty sure it's an import problem (what else can be on line 2 of a source file that can cause such an error?) (*)

    kind regards,

    Jos

    (*) I know, I can create lots of error on line 2 if I wanted to ;-)
    cenosillicaphobia: the fear for an empty beer glass

  10. #10
    Join Date
    Mar 2011
    Posts
    20
    Rep Power
    0

    Default

    Quote Originally Posted by JosAH View Post
    Eclipse will tell you: there's probably a little red icon near that file; open it and check the offending line; hover your mouse over the error icon to see the error message and fix what is wrong.

    kind regards,

    Jos
    when i do this it says :

    Multiple markers at this line
    - The declared package "" does not match the expected package
    "stefan"

  11. #11
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    12,999
    Blog Entries
    7
    Rep Power
    19

    Default

    Quote Originally Posted by stefandanielsen View Post
    when i do this it says :

    Multiple markers at this line
    - The declared package "" does not match the expected package
    "stefan"
    Well, you have to fix that; you probably got away with an incorrect package structure in Jedit but Eclipse doesn't allow such sloppy package structure.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  12. #12
    Join Date
    Mar 2011
    Posts
    20
    Rep Power
    0

    Default

    okay ... how do i do that...?? im pretty new at this

  13. #13
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,446
    Rep Power
    18

    Default

    Presumably your java file is in a directory under the src directory called stefan?
    Then that means the java class needs to be part of a pakcge called stefan.

    Java Code:
    package stefan;
    
    public class BlahBlahBlah {
    }

  14. #14
    Join Date
    Mar 2011
    Posts
    20
    Rep Power
    0

Similar Threads

  1. How do you import?
    By Gary20 in forum New To Java
    Replies: 2
    Last Post: 01-28-2011, 06:12 PM
  2. Help with import
    By eel in forum New To Java
    Replies: 2
    Last Post: 09-19-2010, 10:51 AM
  3. Import
    By gothrog in forum Java Applets
    Replies: 2
    Last Post: 05-13-2010, 11:16 PM
  4. Can not import jxl.*
    By AnnieDing in forum Java Servlet
    Replies: 3
    Last Post: 01-22-2010, 03:52 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
  •