[Logo]
Forums Register Login
Jar is created But while runing says Failed to load Main-Class manifest attribute from
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 ?
What is the output of jar tf PlayQuiz.jar ?
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
The dot in the directory name looks misplaced.
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

What yo you mean by "yes it is"? You need to remove it, since the package name does not have a dot in it.
No there is not .(dot) in package name.

So why did you use one in the jar command?
If you are using a wood chipper, you are doing it wrong. Even on this tiny ad:
ScroogeXHTML 7.1 - RTF to HTML5 / XHTML converter
https://coderanch.com/t/690611/ScroogeXHTML-RTF-HTML-XHTML-converter


This thread has been viewed 580 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 19, 2018 16:35:26.