java jar metainf_java – 在Eclipse中创建META-INF / services文件夹

由于教程正在指示手动创建它,而不是使用ant或maven或其他构建工具,那么只需在根级别创建一个名为Meta-INF的文件夹,其中包含名为services的文件夹和名为MANIFEST.MF的文件.

我不知道如何计划执行你的jar文件,现在你可以把这一行放在你的MANIFEST.MF中:

Manifest-Version: 1.0

对于您的服务文件夹,您需要创建一个名为com.example.dictionary.spi.Dictionary的文件,其中包含以下一行内容,如本教程所述:

com.example.dictionary.GeneralDictionary

FYI – Meta-INF是一个内部Java元目录.一般来说,您希望依靠您的包装工具(如ant或maven)构建Meta-INF文件夹的内容,而不是自行完成.

您可以看到关于Meta-INF文件夹here的内容的详细信息:

The following files/directories in the Meta-INF directory are recognized and interpreted by the Java 2 Platform to configure applications,extensions,class loaders and services:

MANIFEST.MF

The manifest file that is used to define extension and package related data.

INDEX.LIST

This file is generated by the new "-i" option of the jar tool,which contains location information for packages defined in an application or extension. It is part of the JarIndex implementation and used by class loaders to speed up their class loading process.

x.SF

The signature file for the JAR file. 'x' stands for the base file name.

x.DSA

The signature block file associated with the signature file with the same base file name. This file stores the digital signature of the corresponding signature file.

services/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值