• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

creating and executing a jar file

 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Marshal
Posts: 75844
361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have solved the issue. and yeah - it was missing the new line :$ .. thanks
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
author
Posts: 9035
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
intermediate level
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic