Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mahtab Alam
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the output of jar tf PlayQuiz.jar ?
 
Mahtab Alam
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The dot in the directory name looks misplaced.
 
Mahtab Alam
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 391
1
Java MySQL Database PHP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No there is not .(dot) in package name.

 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So why did you use one in the jar command?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic