简体   繁体   English

导入的jar文件会创建空包

[英]Imported jar files creates empty packages

I am importing a Jar file "com.ibm.mq.jar" into my workspace(Eclipse IDE). 我正在将一个Jar文件“com.ibm.mq.jar”导入我的工作区(Eclipse IDE)。 While importing, a screen came where I could see all the classes in the Jar file. 导入时,屏幕出现在我可以看到Jar文件中的所有类的位置。

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). 就像,“MQC”是包中的一个类,但是在代码中它没有反映出来(如果我尝试使用它,“MQC无法解析为类型”错误)。

This jar file actually contains Websphere MQ API classes. 此jar文件实际上包含Websphere MQ API类。

Can anyone advise, what am I missing. 任何人都可以建议,我错过了什么。

If you're using MQ 7, check its documentation here . 如果您使用的是MQ 7,请在此处查看其文档。 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 . 关于com.ibm.mq.mqc弃用有一些问题,并且根据您使用的版本,该类被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. 实际上com.ibm.mq只包含异常MQException ,所以你不会在那里找到任何类。 I suggest you check the version you're using and dig a little deeper into the docs, as a first step. 我建议你查看你正在使用的版本,并深入研究文档,作为第一步。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM