This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Manifest problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Manifest problems " Watch "Manifest problems " New topic
Author

Manifest problems

Stephen Black
Ranch Hand

Joined: Aug 13, 2009
Posts: 50

Having trouble with jar file manifests
I type >Java -jar 17PackAndSend.jar
and i get the error "Could not find or load main class 17PackAndSend.jar"

The manifest is as follows
Manifest-Version: 1.0
Main-Class: 17PackAndSend.Packin

Ant-Version: Apache Ant 1.8.3
Created-By: 1.7.0_10-b18 (Oracle Corporation)

I am out of ideas on this one I even changed the name of the classes folder to match the jar file name all to no avail



[Thumbnail for PackSendJar.png]

Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7892
    
  21

Stephen Black wrote:I am out of ideas on this one I even changed the name of the classes folder to match the jar file name all to no avail

Well, for starters:
Main-Class: 17PackAndSend.Packin
looks bad to me because Java class (and package) names are not allowed to start with numbers.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Mansukhdeep Thind
Ranch Hand

Joined: Jul 27, 2010
Posts: 1157

There should be a carriage return after you specify the Main-Class : <class name> inside your Manifest file. Provide that, make the jar again, and try executing it. Let me know what happens.


~ Mansukh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Manifest problems