“订单和出口"“Java 构建路径"中的选项卡 [英] The "Order and Export" tab in "Java Build Path"

查看:15
本文介绍了“订单和出口"“Java 构建路径"中的选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Java Build Path"对话框中的Order and Export"选项卡有什么用?通过名称'order',我可以猜测JRE System library是在Plug-in Dependencies之前搜索的,但是为什么我们在Build Path中有'Export'?元素左侧的按钮是什么?

添加

这是我从

  • 配置 Eclipse Java 项目
  • Java 构建路径
  • 解决方案

    此选项卡似乎具有双重职责(请参阅 本帮助页面底部 了解少量细节).

    一方面,它用作相关项目构建中所用资源的解析顺序(顺序"部分).另一方面,它还用于定义此构建路径的哪些部分贡献给依赖项目(那些在项目"选项卡中列出此项目以查看此首选项面板的项目)构建路径(导出"部分).

    后一个功能就是为什么复选框存在于左侧,如您所问(请注意,不能取消选中-"符号,因为无法取消选择此项目中定义的源文件,如帮助文件中所述).如果贡献项目不导出该资源,则期望来自贡献项目的某些资源的依赖项目将无法编译/运行.

    此 SO 帖子 以供证实.

    What's the use of "Order and Export" tab in "Java Build Path" dialog box? By the name 'order', I can guess that JRE System library is searched before Plug-in Dependencies, but why do we have 'Export' in Build Path ? And what's it for the button left side of the elements?

    ADDED

    It's the example that I borrowed from Eclipse distilled.

    The orderes.webapp depends on orders, but it's likely to use the classes defined in ubl and catalog.

    In such a case, orders can export catalog and ubl so that the packages that depends on it can use catalog and ubl.

    And something more about "Order and Export".

    1. The check of the left side button modifies the .classpath file to add exported=true such as <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.7.jar"/>.
    2. The src is always checked, and you can't uncheck it.

    References

    解决方案

    This tab seems to pull double duty (see bottom of this help page for small amount of detail).

    On one hand, it functions as the order of resolution for resources used in the building of the project in question (the "Order" part). On the other, it also serves to define what parts of this build path are contributed to dependent projects' (those listing this project in the "projects" tab for their view of this preference panel) build paths (the "Export" part).

    This latter function is why the checkboxes exist on the left hand side, as you ask (note that the '-' signs cannot be unchecked, as source files defined in this project cannot be deselected, as stated in help file). A dependent project that expects some resource from the contributing project will not compile/run if the contributing project doesn't export that resource.

    EDIT: see this SO post for corroboration.

    这篇关于“订单和出口"“Java 构建路径"中的选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆