954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to create a JAR file ?

Does anyone know how to create a JAR file using JCreator ? i have try to create it but it gives me this error " Failed to load Main-Class manifest attribuite from c:\hello\.jar" which i doesn't know how solve it.

k_en
Light Poster
35 posts since Jul 2005
Reputation Points: 13
Solved Threads: 0
 

check the documentation of the jar command.
If you insist on using an IDE to prevent you from learning the language and its tools use its documentation as well.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

You need to create a manifest file yourself.

Open up a notepad file and in it type:

Main-Class: Yourmainclass.withoutthedotextension

Then save it as

MANIFEST.MF

This may not work though. Your best chance would be to jar it up from the command line, which I found to be the best solution.

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

I know JBuilder and ANT (and JBuilder uses ANT for it) can generate the manifest for you if you tell them the required information (like the main class...).
Comes in handy when you want an ANT script that does everything from compiling to testing to building your distribution archives.
RTFM to find out how.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You