Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Problem running an executable jar

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been trying to run a jar. There is a manifest file in it. I have 2 other external jars that are to be used by my application namely log4j.jar and db2jcc.jar.
It is throwing a NoClassFoundException saying that the Logger class cannot be found. What am I supposed to add in manifest file. (Carriage Return has been properly given). Am i supposed to add something in the class path.

Please help me in this regard.

Regards
 
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. The other JAR file. You need to add it to the manifest.
 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just pulled out one of our exec JAR files for an example. Here's the setting in the manifest:

Class-Path: lib/jai_codec.jar lib/jai_core.jar lib/mlibwrapper_jai.jar lib/jtds-1.2.jar



As you can see we use JAI and JTDS. The JAR files for these are in a folder named "lib" which is in the same directory as the executable JAR. The classpath MUST be set in the manifest, the environment variables and -cp option will be ignored when you use -jar.
 
Naresh Rajan
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx it worked. i was putting a '\' in front of the lib and it was not working. now it works!!!
 
You showed up just in time for the waffles! And this 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