Total members 10261 | Gratitudes |It is currently Wed May 23, 2012 9:33 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 2 posts ] 
Author Question
 Question subject: Problem in creating manifest file
PostPosted: Wed Oct 22, 2008 4:57 pm 
Offline
Proficient
User avatar

Joined: Sun Oct 19, 2008 3:47 pm
Posts: 281
Has thanked: 0 time
Have thanks: 1 time

I created a jar file of a package.
And in the manifest file ,wrote the code

Main-Class:com.MyClass

There is no problem in creating the jar file using the following
command-

c:\>jar -cmf abc.mf MyJar.jar com

but when I tried to execute the program using

c:\>java -jar MyJar.jar
It thrown an error
Failed to load main class from manifest file.

Please provide solution to this problem.
Thanks in advance.


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Problem in creating manifest file
PostPosted: Wed Oct 22, 2008 4:58 pm 
Offline
Proficient
User avatar

Joined: Sun Oct 19, 2008 3:53 pm
Posts: 229
Has thanked: 0 time
Have thanks: 0 time
U have to create the jar file by giving the Main class in the
argument
You can create a file Manifest.txt having the following line

Main-Class: com.MyClass


then create the jar using the following command


jar -cmf Myjar.jar Manifest.txt com.MyClass

Then execute the command to run the jar file

java -jar Myjar.jar


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 2 posts ] 
Quick reply


  

 Similar topics
 Image Insert in Excel File Using POI
 ASP file structure
 Search records from text file
 error closing file matlab save
 JavaScript fade out problem
 How to download any file in jsp.
 creating non ordered list using UL tag.
 read php file in asp and display it as html
 javascript read file
 Creating table using div tag

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 5 guests



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team