File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Jar is created But while runing says Failed to load Main-Class manifest attribute from Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jar is created But while runing says Failed to load Main-Class manifest attribute from" Watch "Jar is created But while runing says Failed to load Main-Class manifest attribute from" New topic
Author

Jar is created But while runing says Failed to load Main-Class manifest attribute from

Mahtab Alam
Ranch Hand

Joined: Mar 28, 2012
Posts: 175

I have my main class Quiz3 in package mine

package mine;
//imports
public class Quiz3 extends JFrame{
....
}

Then I created jar file as


jar -cvfm PlayQuiz.jar manifest.txt mine./*.class ( manifest.txt have one line Main-Class:mine.Quiz3 )

It creates jar successfully but when I run it , it gives error "Failed to load Main-Class manifest attribute form C:\Users\Mahtab\Desktop\PayQuiz.jar"

What is the problem ?

Mahtab Alam (OCJP )
Blogs : alamsql.blogspot.in , alammahtab.blogspot.in
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39551
    
  27
What is the output of jar tf PlayQuiz.jar ?


Ping & DNS - updated with new look and Ping home screen widget
Mahtab Alam
Ranch Hand

Joined: Mar 28, 2012
Posts: 175

jar tf Play.jar

META-INF
META-INF/MANIFEST.MF
mine./Quiz3$1.class
mine./Quiz3$2.class
mine./Quiz3$3.class
mine./Quiz3$4.class
mine./Quiz3$5.class
mine./Quiz3$6.class
mine./Quiz3$Report$1.cla
mine./Quiz3$Report$Draw.
mine./Quiz3$Report.class
mine./Quiz3.class
mine./updateCount.class
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39551
    
  27
The dot in the directory name looks misplaced.
Mahtab Alam
Ranch Hand

Joined: Mar 28, 2012
Posts: 175

Yes it is

META-INF
META-INF/MANIFEST.MF
mine./Quiz3$1.class
mine./Quiz3$2.class
mine./Quiz3$3.class
mine./Quiz3$4.class
mine./Quiz3$5.class
mine./Quiz3$6.class
mine./Quiz3$Report$1.class
mine./Quiz3$Report$Draw.class
mine./Quiz3$Report.class
mine./Quiz3.class
mine./updateCount.class

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39551
    
  27
What yo you mean by "yes it is"? You need to remove it, since the package name does not have a dot in it.
Mahtab Alam
Ranch Hand

Joined: Mar 28, 2012
Posts: 175

No there is not .(dot) in package name.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39551
    
  27
So why did you use one in the jar command?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jar is created But while runing says Failed to load Main-Class manifest attribute from
 
Similar Threads
Executable Jar
desktop applications
Executable jar Failed to load Main-Class manifest attribute
Failed to load Main-Class manifest attribute from HelloWorld.jar