The declared package does not match the expected package
eclipse使用import导入源代码到项目中或者通过svn检出等方式导入源码到项目中,控制台容易出现大量错误。
但同时直接使用ant脚本进行编译则能编译成功。
这个时候请不用担心,打开错误可以看到在很多类的开头部分:package出现错误,提示为:
The declared package does not match the expected package
错误的原因是:
eclipse中包的定义一般是通过package包名产生,而不是通过文件的层次来定义。eclipse使用import导入源码时,导入的是文件结构而不是包形式,故报错。
解决方法:
点击> properties > java build path > source > add folder > select src/XXXX
然后重新编译就ok了。
分享到:
相关推荐
用springboot shiro 做的一个小demo ,方便快速入门shiro 会比security容易上手很多;
Maven3实战笔记04——Maven的生命周期和插件。
The book does not assume prior knowledge of Go nor experience with any specific language, so you'll find it accessible whether you're most comfortable with JavaScript, Ruby, Python, Java, or C++. ...
The book does not assume prior knowledge of Go nor experience with any specific language, so you’ll find it accessible whether you’re most comfortable with JavaScript, Ruby, Python, Java, or C++. ...
codeblocks中报错:'to_string' was not declared in this scope解决方案
The vision is “To produce the best UNIX-like operating system package possible, with due respect to the original software tools ideology as well as usability, performance and stability.” The ...
_HID does not match the predefined PCI Root Bridge IDs, the _CID list (if present) is now obtained and also checked for an ID match. Implemented additional support for the PCI _ADR execution: up...
* The Shell Extension components does not support C++ Builder 4. For some strange reason the components causes a link error. * There appear to be sporadic problems compiling with C++ Builder 5. ...
Suppose if we have declared an array of type int then the array will take only the int values and not any other data types. We can find find out the length of the variable by using the variable ...
“Without the belief that it is possible to grasp reality with our theoretical constructions, without the belief in the inner harmony of our world, there could be no science,” the book declared....
The software contains all files of the installation package except for the "Dump" folder contents. This LICENSE AGREEMENT ("LICENSE") defines what the USER may do with the SOFTWARE, and contains ...
•Q584524 - Ribbon - QAT doesn't display the double arrow if the Ribbon control's PopupMenuItems set does not include items •Q581962 - Ribbon - Switching between maximized MDI child windows using the...
What can I check if I am not seeing the expected version of a dependency? Why am I getting an error 'cannot find module providing package foo'? Why does 'go mod init' give the error 'cannot determine ...
It is important to know that functions are not always inlined even if they are declared as such; for example, virtual and recursive functions are not normally inlined. Usually recursive functions ...
- Does not allow to leave the current record of DataSet with keyboard keys. - When the current cell in the grid is on the last line, the Tab key on the grid translates the input focus to the next ...
handling capabilities, and the use of assertions to validate the expected behavior of code. <br>Chapter 13Strings and Regular Expressionsdescribes the built-in language and runtime support for ...
Linux系统,需要安装如下依赖库: #####Library ... In the manifest.xml the only declared package dependencies are roscpp, tf, sensor_msgs, image_transport, cv_bridge, which are all BSD licensed.
In earlier revisions, the error status light was cleared after a VsSetWavelength() call failed, so the user did not see the light turn red to alert that an error had occurred. This has been fixed in ...
o The Version 1.5 graphics drivers (*.BGI) are not compatible with the Version 2.0 graphics library. Use the graphics drivers distributed with Version 2.0. o When used with a Zenith Z-449 card, ...
If you are building your project with runtime packages, remove the cxBarEditItemRS~ packages from the project's runtime package lists. ExpressLibrary # BC3316: The cxRectOffsetF global function ...