Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

jar file problem

  Asked By: Ruben    Date: Nov 04    Category: Java    Views: 679
  

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.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on jar file problem Or get search suggestion and latest updates.




Tagged: