META-INF文件夹是干啥的,META-INF文件夹的作用, META-INF文件夹能删吗
来源:互联网 发布:易语言2017盗号源码 编辑:程序博客网 时间:2024/06/01 14:47
今天有人问到 META-INF文件夹是干啥的,META-INF文件夹的作用, META-INF文件夹能删吗,还有项目的META-INF下面一般会有个MANIFEST.MF 文件,都是干啥的。
百度搜了一下,基本找不到答案。于是上stakoverflow搜,得到如下答案:
If you remove META-INF from a jar then there is no MANIFEST.MF and so java -jar can't find the main class.
You can create jars without META-INF but when you are going to execute a jar a META-INF/MANIFEST.MF is required.
See http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html
这句英文很简单,简单翻译如下:
如果你将Jar中的META-INF文件夹删除,那么jar文件里边就没有MANIFEST.MF文件。那么,java -jar就找不到main class.
没有META-INF你仍然可以创建一个Jar文件。但是,当你想要执行jar文件的时候,这个jar是需要具备 META-INF/MANIFEST.MF的。
我们在使用eclipse或者myeclipse新建项目之后,在项目中可以找到META-INF文件夹,下面有个MANIFEST.MF。
打开之后发现里边只有:
Manifest-Version:
1.0
Class-Path:
瞬间变有疑问:这么少点信息,有啥作用。为啥上面那段英文说的这个文件这么的不可或缺。
于是我随便在项目的lib中找了一个jar文件commons-io-2.3.jar,打开,把里边的MANIFEST.MF文件拿出来,打开如下:
Manifest-Version:
1.0
Export-Package: org.apache.commons.io.output;version=
"2.3"
,org.apache.
commons.io.monitor;version=
"2.3"
,org.apache.commons.io.filefilter;ver
sion=
"2.3"
,org.apache.commons.io.comparator;version=
"2.3"
,org.apache.
commons.io.input;version=
"2.3"
,org.apache.commons.io;version=
"2.3"
Implementation-Title: Commons IO
Built-By: ggregory
Tool: Bnd-
1.50
.
0
Implementation-Vendor: The Apache Software Foundation
Implementation-Vendor-Id: org.apache
Specification-Title: Commons IO
Bundle-License: http:
//www.apache.org/licenses/LICENSE-2.0.txt
Bundle-SymbolicName: org.apache.commons.io
X-Compile-Target-JDK:
1.6
Implementation-Version:
2.3
Specification-Vendor: The Apache Software Foundation
Bundle-Name: Commons IO
Created-By: Apache Maven Bundle Plugin
X-Compile-Source-JDK:
1.6
Bundle-Vendor: The Apache Software Foundation
Build-Jdk:
1.6
.0_31
Bundle-Version:
2.3
.
0
Bnd-LastModified:
1334069963279
Bundle-ManifestVersion:
2
Bundle-Description: The Commons IO library contains utility classes, s
tream implementations, file filters, file comparators, endian transfo
rmation classes, and much more.
Bundle-DocURL: http:
//commons.apache.org/io/
Implementation-Build: tags/
2.3
-RC1
@r1311772
;
2012
-
04
-
10
10
:
59
:
15
-
0400
Specification-Version:
2.3
Include-Resource: META-INF/LICENSE.txt=LICENSE.txt,META-INF/NOTICE.txt
=NOTICE.txt
Archiver-Version: Plexus Archiver
密密麻麻一大片,是一行行的,类似配置文件,前面一个'key' 后面一个‘value’
具体这些玩意有啥用,META-INF 里边还可以放啥,可击上面文字中提供的的连接。好长一片英文,感兴趣的话,慢慢看吧。
http://www.cnblogs.com/demingblog/p/5653844.html
- META-INF文件夹是干啥的,META-INF文件夹的作用, META-INF文件夹能删吗
- meta-inf文件夹的作用和意义
- "META-INF"文件夹
- Eclipse中 WEB-INF 和 META-INF 文件夹的信息
- Eclipse中web-inf和meta-inf文件夹的信息
- Eclipse中web-inf和meta-inf文件夹的信息
- Eclipse中web-inf和meta-inf文件夹的信息
- Eclipse中web-inf和meta-inf文件夹的信息
- Eclipse中web-inf和meta-inf文件夹的信息
- Eclipse中web-inf和meta-inf文件夹的信息
- Eclipse中web-inf和meta-inf文件夹的信息
- myEclipse中web-inf和meta-inf文件夹的信息
- JAR文件中的META-INF文件夹的作用
- META-INF的作用
- META-INF文件夹中services的文件夹用法
- jar 包中的META-INF文件夹下面的MANIFEST.MF
- JAR文件中的META-INF文件夹
- META-INF文件夹中的MANIFEST.MF 有什么作用?
- MUI常用组件之对话框
- 编译原理与编译构造 课堂笔记9
- Windows消息机制
- LeetCode 2 Add Two Number
- java--charAt()
- META-INF文件夹是干啥的,META-INF文件夹的作用, META-INF文件夹能删吗
- HDU1789Doing Homework again
- PS(三)
- vue.js初学3之vue指令②
- OSPF笔记-8
- hadoop入门八(搭建环境)
- LaTeX公式语法1
- 在linux安装依赖于python包时,报错libpython.a: conld not read symbols
- java链表结构基本形式(学习笔记)