Exception in thread "main" java.lang.NoClassDefFoundError:...
807575Jul 31 2007 — edited Aug 1 2007Hello everyone,
First I would like to apologize if this is not the good forum, I've tried to figure out the most relevant for my problem.
We got a small java application that send a message to MQ Server. All the files are in the same directory (MQSampleSender.java, MQSampleSender.class, com.ibm.mq.jar).
If I launch "java MQSampleSender" under w2k with java 1.6.0_02, it is working. The same directory content, under Solaris 10, JDK1.5.0, I've got :
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/mq/MQQueueManager
at MQSampleSender.main(MQSampleSender.java:45)
I'm a bit confuse. MQQueueManager.class is in com.ibm.mq.jar, file that is in the current directory. The first line of my java file is
import com.ibm.mq.*
I've done some research on internet, and it look like a CLASSPATH problem. My current CLASSPATH under Solaris is empty. Do I need to have a value in there ? (even if all files are in the current directory except java.util.*) Do I need to at least have a reference to a java directory to be able to import java.util.hashtable; ? Is that the source of the error message (that seem to identify the com.ibm.mq.jar as origin of the problem ?)
Thanks for advices and suggestions,
Sylvain Croteau