Reputation:
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. 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 .
Thanks
Upvotes: 0
Views: 201
Reputation: 94653
Take a look at Setting an Application's Entry Point
EDIT:
Test.java
package pk;
public class Test{
public static void main(String []args) {
System.out.println("Hello World");
}
}
mf manifest file entry
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
Upvotes: 1