Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » declared package does not match the expected package(package identification)
declared package does not match the expected package [message #559113] Wed, 15 September 2010 16:15 Go to next message
Jim Anderson is currently offline Jim AndersonFriend
Messages: 109
Registered: October 2014
Senior Member
I have just started setting up Eclipse 3.51 with java source code.

I have created a source directory, 'bfs', under which all my source code exists in subdirectories. When build the bfs project I get hundreds of errors related to source files declaring the package and imports. The source code compiles cleanly when I compile outside of Eclipse using javac.

For example, I have a file located at:

bfs/util/genbase/thread/GenbaseThread.java

with a package declaration:

package bfs.util.genbase.thread;

What can I do in Eclipse to get a clean compile?

Thank you in advance

Jim Anderson
Re: declared package does not match the expected package [message #559120 is a reply to message #559113] Wed, 15 September 2010 16:31 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
Create a source folder for example src and move bfs under that source folder.
Re: declared package does not match the expected package [message #559125 is a reply to message #559120] Wed, 15 September 2010 16:46 Go to previous messageGo to next message
Jim Anderson is currently offline Jim AndersonFriend
Messages: 109
Registered: October 2014
Senior Member

The bfs directory is already a subdirectory of src.

Originally, when creating the 'bfs' project, I set the source directory for the project as the bfs directory. After you suggestion, I deleted the bfs project and recreated it with a source directory of 'src' which has bfs as a subdirectory. I received the same error messages.


Jim
Re: declared package does not match the expected package [message #559354 is a reply to message #559125] Thu, 16 September 2010 13:08 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Jim Anderson wrote:
>
> The bfs directory is already a subdirectory of src.
>
> Originally, when creating the 'bfs' project, I set the source
> directory for the project as the bfs directory. After you suggestion,
> I deleted the bfs project and recreated it with a source directory of
> 'src' which has bfs as a subdirectory. I received the same error
> messages.
You need to check the Java build path: it has to have 'src' as source
folder. Also, make sure that either auto-build is enabled or you rebuild
the project.

Dani
>
>
> Jim
Re: declared package does not match the expected package [message #629486 is a reply to message #559354] Tue, 28 September 2010 13:17 Go to previous message
Jim Anderson is currently offline Jim AndersonFriend
Messages: 109
Registered: October 2014
Senior Member

Got it. Thank you for the help.
Previous Topic:Ant editor giving problems for Ant 1.8 in Helios
Next Topic:JRE not recognised in eclipse IDE
Goto Forum:
  


Current Time: Fri Apr 26 21:53:55 GMT 2024

Powered by FUDForum. Page generated in 0.03638 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top