`
zhouqiang128
  • 浏览: 91068 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

The declared package does not match the expected package

 
阅读更多
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了。
分享到:
评论

相关推荐

    spring boot shiro demo项目

    用springboot shiro 做的一个小demo ,方便快速入门shiro 会比security容易上手很多;

    Maven3实战笔记04Maven的生命周期和插件

    Maven3实战笔记04——Maven的生命周期和插件。

    The Go Programming Language(Addison,2015)

    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.Go.Programming.Language.0134190440.epub

    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解决方案

    codeblocks中报错:'to_string' was not declared in this scope解决方案

    a project model for the FreeBSD Project.7z

    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 ...

    acpi控制笔记本风扇转速

    _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...

    Senfore_DragDrop_v4.1

    * 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. ...

    JSP Simple Examples

    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 ...

    The evolution of physics by Einstein and Infeld 1938

    “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....

    mysql 客户端软件 mymanager_lite

    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 ...

    DevExpress VCL 13.2.5 D7-DXE6 FullSource

    •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...

    Go Modules.docx

    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 ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    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 ...

    EHLib 6.3.171〖D7~XE5〗

    - 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 ...

    Addison.Wesley.The.Java.Programming.Language.4th.Edition.Aug.2005.chm

    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 ...

    ORB_SLAM2.tar.gz

    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.

    LCTF软件备份VariSpec™ Liquid Crystal Tunable Filters

    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 ...

    Turbo C 2.00[DISK]

    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, ...

    DevExpress VCL_15.2.2_FS(一共2个压缩分卷,这是第2个)

    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 ...

Global site tag (gtag.js) - Google Analytics