File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Manifest file problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Manifest file problems" Watch "Manifest file problems" New topic

Manifest file problems

Chris Dancy
Ranch Hand

Joined: Feb 14, 2006
Posts: 136
I posted about a week ago, on this problem, and still im having problems. Just trying to create an executable jar file. This is what im doing. At the command line I'm typing:

jar cvfm package.jar "C:\mydocuments\Messenger"

my manifest file looks exactly like this: Main-Class:

yet when i run the executable jar file, it sais it cannot find the main class? what am i doing wrong? Thanks in advance for the help.

("Anger is not an emotion, its a symptom of fear.")
Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961
Main-Class is not the OS file path to the java class, but the actual package path to the class.

Main-Class: com.ranch.Application
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24187

As Jeff says, the class name is what goes in the "Main-Class" line. Also note that the jar file itself must contain the compiled *.class file; the *.java file is no use here.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: Manifest file problems