Results 1 to 8 of 8
- 10-23-2009, 05:53 PM #1
Member
- Join Date
- Oct 2009
- Posts
- 4
- Rep Power
- 0
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
- 10-23-2009, 06:21 PM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
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.
- 10-23-2009, 07:07 PM #3
Member
- Join Date
- Oct 2009
- Posts
- 4
- Rep Power
- 0
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?
- 10-23-2009, 07:26 PM #4
Member
- Join Date
- Oct 2009
- Posts
- 4
- Rep Power
- 0
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)
- 10-23-2009, 07:51 PM #5
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
If you just add the jar file to your project's build path then you won't get all those problems.
- 10-23-2009, 08:27 PM #6
Member
- Join Date
- Oct 2009
- Posts
- 4
- Rep Power
- 0
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.
- 10-23-2009, 08:31 PM #7
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
That's because you added the source codes. Remove them from the project and just leave the jar file together with your code.
- 11-09-2009, 07:51 AM #8
Member
- Join Date
- Nov 2009
- Posts
- 1
- Rep Power
- 0
Similar Threads
-
jxl package
By little_polarbear in forum New To JavaReplies: 5Last Post: 05-05-2009, 02:19 PM -
Regarding package
By makpandian in forum New To JavaReplies: 2Last Post: 03-24-2009, 05:47 PM -
JXL Package
By gaya3 in forum Java ServletReplies: 1Last Post: 05-23-2008, 09:03 AM -
Package Explorer
By bilmeze in forum EclipseReplies: 0Last Post: 04-04-2008, 08:57 AM -
Importing package
By bugger in forum New To JavaReplies: 5Last Post: 11-26-2007, 12:29 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks