aspose file tools
The moose likes Java in General and the fly likes creating and executing a jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "creating and executing a jar file" Watch "creating and executing a jar file" New topic
Author

creating and executing a jar file

Em Aiy
Ranch Hand

Joined: May 11, 2006
Posts: 225
I am trying to create and execute a jar file. the jar file has few depencies. the manifest.mf file is



and when i try to run the jar file with following command



it gives me following error


What mistake am i doing? i am unable to get it working .. any help?


The difference between <b>failure</b> and <b>success</b> is often being <b>right</b> and being <b>exactly right</b>.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32611
    
    4
Don't know.

Have you really got 3 lines in the Manifest? There should be 4, the last line being empty.
I presume you have read the Java Tutorials section, where it says you must end with a line terminator character. Shouldn't you have all those jars in the classpath part of the Manifest file, rather than listing them at the command line?
Em Aiy
Ranch Hand

Joined: May 11, 2006
Posts: 225
I have solved the issue. and yeah - it was missing the new line :$ .. thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35224
    
    7
java -cp D:\alerter-jar\activation.jar D:\alerter-jar\commons-codec.jar D:\alerter-jar\commons-httpclient.jar D:\alerter-jar\commons-logging.jar D:\alerter-jar\log4j.jar D:\alerter-jar\mail.jar -jar node-alerter.jar

Another problem here is that you have space characters in the classpath. That's why the JVM thought "D:\alerter-jar\commons-codec.jar" was the name of the class you were trying to execute. But since you specify all the jar files in the manifest, there's no need to have a classpath here at all.


Android appsImageJ pluginsJava web charts
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8712
intermediate level


Eliminate fossil fuel subsidies. (If you're not on the edge, you're taking up too much room.)
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: creating and executing a jar file
 
Similar Threads
Problems creating a Jar file
org.xml.sax.SAXParseException: The content of element type "forward" must match" Please help
Issue in deploying the web service
RunJavaApplication As Executable Jar
refering a property file in the manifest