The Artima Developer Community
Sponsored Link

Java Answers Forum
Failed to load Main-Class manifest attribute from ... .jar

12 replies on 1 page. Most recent reply: Sep 9, 2007 10:46 PM by san htat

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 12 replies on 1 page
Yeseanul

Posts: 7
Nickname: yeseanul
Registered: Jun, 2005

Failed to load Main-Class manifest attribute from ... .jar Posted: Jun 2, 2005 3:20 AM
Reply to this message Reply
Advertisement
Every time I try to run a .jar fine on my PC, I get this error massage: "Failed to load Main-Class manifest attribute from ... .jar". This happens to all .jar files. I am using WinXP SP2 MC Edition and JAVA 1.4.2.04 or 1.5.0.02 version.
Can anybody help me?


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: Failed to load Main-Class manifest attribute from ... .jar Posted: Jun 5, 2005 10:53 PM
Reply to this message Reply
The answer is simple: There is no mainclass attribute in the manifest.

These jar files are not made to be executed as applications.

Are this jar files for a browser, java midlet files for cell phones or just extensions for other programs?

Yeseanul

Posts: 7
Nickname: yeseanul
Registered: Jun, 2005

Re: Failed to load Main-Class manifest attribute from ... .jar Posted: Jun 5, 2005 11:04 PM
Reply to this message Reply
> The answer is simple: There is no mainclass attribute in
> the manifest.
>
> These jar files are not made to be executed as
> applications.
>
> Are this jar files for a browser, java midlet files for
> cell phones or just extensions for other programs?

Thank you for your answer.

I also figured out that there is no mainclass attribute in the manifest. I tried to locate the mainclass and write it in the manifest; but from 5 or 15 classes, I don't know which the main one is. On the top of that, I don't think I know how to rewrite the manifest.
The .jar files are midlet files for cell phones. The idée is to run the .jar files on my PC in order to make an idée about the midlet, and then to load it to my phone.

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: Failed to load Main-Class manifest attribute from ... .jar Posted: Jun 6, 2005 5:35 AM
Reply to this message Reply
I don't know how to execute Midlet software directly.

It is possible, that there is no midlet emulator integrated in JSE.

But I was able to load a Midlet jar file in Netbeans. In the properties of the jar file you can choose the Midlet Emulator instead of standard Java.
When you then execute the Jar file, an image of a cell phone will appear with the application in it.

Yeseanul

Posts: 7
Nickname: yeseanul
Registered: Jun, 2005

Re: Failed to load Main-Class manifest attribute from ... .jar Posted: Jun 9, 2005 8:09 AM
Reply to this message Reply
> I don't know how to execute Midlet software directly.
>
> It is possible, that there is no midlet emulator
> integrated in JSE.
>
> But I was able to load a Midlet jar file in Netbeans. In
> the properties of the jar file you can choose the Midlet
> Emulator instead of standard Java.
> When you then execute the Jar file, an image of a cell
> phone will appear with the application in it.


Ok. It is very nice to hear that somebody manage to run midlets on PC.
I tried to do what you said, bun I didn't figure it out. I'm not familiarized with NetBeans. Like I said, I looked for the properties in order to change...
Anyway, I appreciate if you can guide me step by step, so I can manage to run the midlets.
Thank you very much.

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: Failed to load Main-Class manifest attribute from ... .jar Posted: Jun 10, 2005 12:39 AM
Reply to this message Reply
Honestly?
I don't remember. I stumbled somehow over it in NB3.6.
Until now I ould not find out how to do it in NB4.


But I'll look into it.

Yeseanul

Posts: 7
Nickname: yeseanul
Registered: Jun, 2005

Re: Failed to load Main-Class manifest attribute from ... .jar Posted: Jun 10, 2005 12:46 AM
Reply to this message Reply
> Honestly?
> I don't remember. I stumbled somehow over it in NB3.6.
> Until now I ould not find out how to do it in NB4.
>
>
> But I'll look into it.


Thanks. If you manage to remember how to do it in NB 3.6, or if you find a way in NB 4, please let me know.
I appreciate your help.

yeseanul2000@yahoo.fr

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: Failed to load Main-Class manifest attribute from ... .jar Posted: Jun 10, 2005 1:28 AM
Reply to this message Reply
The bad news:
Did not find out how to do it in NB4, in NB3.6 you could simply change the compiler/executer options for every file.

The good news:
Download the J2ME Wireless Toolkit form the Sun website.
It includes everything you need.

Yeseanul

Posts: 7
Nickname: yeseanul
Registered: Jun, 2005

Re: Failed to load Main-Class manifest attribute from ... .jar Posted: Jun 10, 2005 3:22 AM
Reply to this message Reply
> The bad news:
> Did not find out how to do it in NB4, in NB3.6 you could
> simply change the compiler/executer options for every
> file.
>
> The good news:
> Download the J2ME Wireless Toolkit form the Sun website.
> It includes everything you need.


Thank you very much. It was so simple after all. Just using J2ME Wireless Toolkit it is possible to run .jar files (MIDlets).
God bless!

Salman Syed

Posts: 3
Nickname: syedsalman
Registered: Jul, 2007

Re: Failed to load Main-Class manifest attribute from ... .jar Posted: Jul 11, 2007 5:18 AM
Reply to this message Reply
hi,
i don`t know almost anything about java but i just downloaded a game for my mobile with .JAR extension, and i want to run it on my PC as well but the same error is coming, please tell me what to do...i am running Windows XP.
Again, i don`t know anything about JAVA.

Salman Syed

Posts: 3
Nickname: syedsalman
Registered: Jul, 2007

Re: Failed to load Main-Class manifest attribute from ... .jar Posted: Jul 11, 2007 5:37 AM
Reply to this message Reply
Like to add few more things... i downloaded Games and application both...
here is what i did.
first i rename my jar file to a zip file.
extracted the content
went to META-INF directory.
opened the MANIFEST.MF file in JCreator v4.
added line "Main-Class: Browser" considering Browser.class as main class.
zipped the file again and rename it back to jar extension.
But the same error appear.
i repeated the process and changed the class name "Browser" in MANIFEST.MF with other classes which could be the main class, but no good.
i am using jre 1.6

Salman Syed

Posts: 3
Nickname: syedsalman
Registered: Jul, 2007

Re: Failed to load Main-Class manifest attribute from ... .jar Posted: Jul 11, 2007 6:05 AM
Reply to this message Reply
Another Update...
after the line "Main-Class: Browser" i pressed enter to give a line. And the error changed.
its now "Could not find the main class. Program will exit."
kept changing the class name, but no good...
did all this with other applications too, but all this is same for all the applications.

san htat

Posts: 1
Nickname: shtat
Registered: Sep, 2007

Re: Failed to load Main-Class manifest attribute from ... .jar Posted: Sep 9, 2007 10:46 PM
Reply to this message Reply
Hi, I just want to know if you could explain it further for me. Like how do I make a jar file for it to run as an application in Eclipse. Cheers, San

Flat View: This topic has 12 replies on 1 page
Topic: Failed to load Main-Class manifest attribute from ... .jar Previous Topic   Next Topic Topic: Callin DLL from java without jni

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use