I am creating a jar file, such that it will run without unpacking the
contents of jar file. For this to work, i put the following lines of code in the
mytest.txt file:
Main-Class: Test
where Test is the main class, i.e. main() is implemented in class Test.
Then I run the following command:
jar cmf mytest.txt Test.jar *.class
and the jar file is created successfully.
But when I try to execute this jar file by the command: java -jar Test.jar, the
following run time errors are thrown:
Failed to load Main-Class manifest attribute from Test.jar
What mistake I have commited? How can I solve this problem? I have the latest
version of java installed i.e. j2sdk1.4.2.