• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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

 
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • 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 ?
 
Rancher
Posts: 42975
76
  • 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
  • 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
Posts: 42975
76
  • 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
  • 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
Posts: 42975
76
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No there is not .(dot) in package name.

 
Ulf Dittmer
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So why did you use one in the jar command?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!