Results 1 to 8 of 8
  1. #1
    oneforall is offline Member
    Join Date
    Oct 2009
    Posts
    4
    Rep Power
    0

    Default The declared package does not match the expected package

    Hi everyone,

    I have a problem importing an external project. I go file->import->existing projects into workspace, choose the folder where the project is located and everything is imported - but the package names of the project don't seem to be what Eclipse expects. The package names all have a prefix:

    prefix.packagename1
    prefix.packagename2
    etc.

    But Eclipse expects

    packagename1
    packagename2
    etc.

    I don't really want to mess around with external code, so how do I tell Eclipse to create some kind of super-package "prefix"? Or what else can I do?

    Thanks a lot,
    oneforall

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    If you are not going to be changing it, why not bundle it into a jar file and include that jar file in your project's classpath.

    P.S And all for one.

  3. #3
    oneforall is offline Member
    Join Date
    Oct 2009
    Posts
    4
    Rep Power
    0

    Default

    Okay... I forgot to mention that I'm also a noob and need serious hand-holding.
    I just don't want to change the package names because I'm afraid of problems with external updates later. The whole thing came in a jar file, but adding that to the classpath doesn't help: It only adds another branch to my project containing class-files (the project comes with sourcecode and class-files in the same folders). What exactly should I bundle in a jar file and how do I do it?

  4. #4
    oneforall is offline Member
    Join Date
    Oct 2009
    Posts
    4
    Rep Power
    0

    Default

    Btw I don't know if that's easier than trying to get useful information out of me, but you could have a look at the project.
    legacy.lclark.edu/~drake/Orego.html
    The jar file is here:
    webdisk.lclark.edu/drake/orego/
    (the latest one)

  5. #5
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    If you just add the jar file to your project's build path then you won't get all those problems.

  6. #6
    oneforall is offline Member
    Join Date
    Oct 2009
    Posts
    4
    Rep Power
    0

    Default

    I added it under configure build path->libraries. Unfortunately, it doesn't help because as I said, it only adds folders full of class files to my project. The problem with the unexpected package names persists.

  7. #7
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    That's because you added the source codes. Remove them from the project and just leave the jar file together with your code.

  8. #8
    ganey6 is offline Member
    Join Date
    Nov 2009
    Posts
    1
    Rep Power
    0

    Default projects

    hi everyone

    If your projects has to be finished soon and need to do new projects in java.If anyone intersted.looking forward.

Similar Threads

  1. jxl package
    By little_polarbear in forum New To Java
    Replies: 5
    Last Post: 05-05-2009, 03:19 PM
  2. Regarding package
    By makpandian in forum New To Java
    Replies: 2
    Last Post: 03-24-2009, 06:47 PM
  3. JXL Package
    By gaya3 in forum Java Servlet
    Replies: 1
    Last Post: 05-23-2008, 10:03 AM
  4. Package Explorer
    By bilmeze in forum Eclipse
    Replies: 0
    Last Post: 04-04-2008, 09:57 AM
  5. Importing package
    By bugger in forum New To Java
    Replies: 5
    Last Post: 11-26-2007, 01:29 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
  •