• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NoClassDefFoundError in jar file

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I wrote a small MQ/Java program, which I encapsulate in a jar file.
If I include in the jar the com.ibm.mq classes, it works fine. But if I include only the classes that I have wrote, it launches de following exception, when run it:
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/mq/MQException
Im sure the PATH and CLASSPATH are ok, because if I execute:
javap com/ibm/mq/MQException
it shows all the methods of the class.
Some help will be apreciated. Thanks
 
author
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What environment are you running your program in? It sounds as though the environment your running in does not the com/ibm/mq/MQException class in *its* classpath. For instance, you'll often have a situation where you system classpath allows you to compile fine but when run in a web server, the server cannot find some classes. This is because the web server starts up and uses it own classpath to initialize it's JVM instance. Just a thought.
Sean
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic