我觉得我已经完成了修复此错误的正确步骤,并且我在 SO 和其他地方查看了与此相关的其他问题,但出于某种原因我仍然遇到问题。
我正在尝试使用 Apache JMeter 源代码建立一个项目。
例如,文件 BeanShellAssertion.java
位于
~/workspace/apache-jmeter-2.9/src/components/org/apache/jmeter/assertions.
我的源文件夹是src/components
。 BeanShellAssertion.java
中的包声明是
package org.apache.jmeter.assertions;
看着它,似乎一切都按照预期的方式设置。但是,包声明导致错误:
The declared package "org.apache.jmeter.assertions" does not match the
expected package "components.org.apache.jmeter.assertions"
图片如下。我到底做错了什么?
最佳答案
把你的src/components/
放到源码路径
right click > properties > java build path > source > add folder > select
src/components
关于java - 如何修复 Eclipse 上的 "declared package does not match the expected package"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17663521/