This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoClassDefFoundError in jar file

 
Alf Fernandez
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic