This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes IDEs, Version Control and other tools and the fly likes Properly Setting up a Manifest file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Properly Setting up a Manifest file" Watch "Properly Setting up a Manifest file" New topic
Author

Properly Setting up a Manifest file

Scott Kimberly
Greenhorn

Joined: Mar 04, 2012
Posts: 25
Im fairly confident that im having trouble with my JAR file creation because i cant get the Manifest file right.

I have 1 .java file that i want to make into a JAR. It is located here: C:\Users\scott\headfirst java workspace\headfirst java\src\chatClient\SimpleChatClient

The Manifest file is in the same directory, ie -> C:\Users\scott\headfirst java workspace\headfirst java\src\chatClient\Manifest

My Manifest file reads as follows:


It has the return at the end. Ive tried leaving it as just Main-Class: SimpleChatClient and also putting the full extension like i did above.

Where am i going wrong?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

You just put the class name there. That includes the package name, if you put the class in a package, but not the ".class" file extension. Where the class happens to have come from, in your IDE's directories, is irrelevant to the jar and its users.
Scott Kimberly
Greenhorn

Joined: Mar 04, 2012
Posts: 25
Paul Clapham wrote:You just put the class name there. That includes the package name, if you put the class in a package, but not the ".class" file extension. Where the class happens to have come from, in your IDE's directories, is irrelevant to the jar and its users.


Thanks!

I changed it to the package.javaclass (with no extension of course) and it worked.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Properly Setting up a Manifest file
 
Similar Threads
Executing my .java in package
Got an error message Failed to load Main-class manifest attribute from sampleproject.jar
Java2WSDL in AXIS 1.4 shows shows java.lang.NoClassDefFoundError: org/apache/axis/wsdlgen/Java2WSDL
having issues with compile for AdviceBean from HF EJB
ant file not running