adding main class into the manifest file
I created a jar file like this :
jar cf myJAR.jar *.class
But this thing is not executable because the mainfest file does not know in which .class
file is 开发者_StackOverflow社区the main file ?
Now how can i set the main class into the manifest file ?
The manifest file must include the following line
Main-Class: MyPackage.MyClass
In JDK6 there is a commandline parameter to add it automatically
jar cfe Main.jar foo.Main foo/Main.class
foo is the package in this example. The second example creates the manifest automatically.
精彩评论