Take the 2-minute tour ×

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.

share|improve this question
Add the jar to the Java Build Path preference windows and then reorganize imports (ctrl + shift + o). Importing is not as adding the jar to project classpath IIRC –  BigMike Nov 8 '12 at 13:43
add comment

1 Answer

up vote 1 down vote accepted

If you're using MQ 7, check its documentation here. There was some stuff going on about deprecation of com.ibm.mq.mqc and, depending on the version you use, that class was replaced by com.ibm.mq.constants.MQConstants. Like this one, there are other cases.

In fact com.ibm.mq only contains the exception MQException, 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.

share|improve this answer
add comment

Your Answer


