TennSeven TennSeven - 3 months ago 17
Java Question

How do I fix a "declared package does not match the expected package" error on Eclipse?

I've feel like I have gone through the proper steps to fix this error, and I've looked at other questions about this in SO and other places, but for some reason I'm still having an issue.

I am trying to set up a project using the Apache JMeter source code.

As an example, the file

is in


My source folder is
. The package declaration in

package org.apache.jmeter.assertions;

Looking at it, it seems like everything is set up the way it is supposed to be. However, the package declaration is causing an error:

The declared package "org.apache.jmeter.assertions" does not match the
expected package "components.org.apache.jmeter.assertions"

Image is below. What exactly am I doing wrong here?

enter image description here

enter image description here


put your src/components/ to source path

right click > properties > java build path > source > add folder > select src/components