I am importing a Jar file “com.ibm.mq.jar” into my workspace(Eclipse IDE).
While importing, a screen came where I could see all the classes in the Jar file.
After I imported it into the work space, I was able to import the package and following statement didn’t give any error.
import com.ibm.mq.*;
But, in code I am not able to use any of the classes which were there in the package.
Like, “MQC” is a class in the package, but in code it doesn’t reflect(“MQC cannot be resolved as a type” error comes if I try to use it).
This jar file actually contains Websphere MQ API classes.
Can anyone advise, what am I missing.
If you’re using MQ 7, check its documentation here. There was some stuff going on about deprecation of
com.ibm.mq.mqcand, depending on the version you use, that class was replaced bycom.ibm.mq.constants.MQConstants. Like this one, there are other cases.In fact
com.ibm.mqonly contains the exceptionMQException, so you won’t find any classes there. I suggest you check the version you’re using and dig a little deeper into the docs, as a first step.