简体   繁体   English

清单文件不包含属性

[英]manifest file not containing an attribute

Thanks for your answers. 感谢您的回答。 I'm still having a fault saying manifest file does not contain a file/object attribute, after I had created my jar file for my application. 在为应用程序创建了jar文件之后,我仍然有一个错误,说清单文件不包含file / object属性。 I'm doubting maybe I didn't know what exactly the main-class represent in a manifest file while writing the code. 我怀疑也许我不知道在编写代码时清单文件中主类的确切含义。 please illustrate taking an example from the HelloWorld . 请以HelloWorld为例进行说明。

Thanks 谢谢

Take a look at Setting an Application's Entry Point 看一下设置应用程序的入口点

EDIT: 编辑:

Test.java Test.java

package pk;

public class Test{
   public static void main(String []args) {
       System.out.println("Hello World");
   }
}

mf manifest file entry MF清单文件条目

Main-Class: pk.Test

Compilation 汇编

>javac Test.java -d .

Create a Jar 创建一个罐子

>jar -cvfm my.jar mf pk

Test the jar 测试罐子

>java -jar my.jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM