java javax.jms 不存在 - 编译 activemq 示例

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/252016/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 11:38:41  来源:igfitidea点击:

javax.jms does not exist - compiling activemq examples

javanetbeansjmsactivemq

提问by Scott Cowan

I'm trying to compile the examples that come with activemq

我正在尝试编译 activemq 附带的示例

in apache-activemq-5.1.0\example\src\

在 apache-activemq-5.1.0\example\src\

TopicPublisher.java, CommandLineSupport.java

TopicPublisher.java, CommandLineSupport.java

on compiling thru netbeans it has some referencing problems saying javax.jms does not exist.

在通过 netbeans 编译时,它有一些引用问题,说 javax.jms 不存在。

I've tried the j2ee.jar, openjms, sun jms but they all give the same error.

我尝试过 j2ee.jar、openjms、sun jms,但它们都给出了相同的错误。

its also complaining about org.apache.activemq.util does not exist but I'm referencing activemq-all-5.1.0.jar.

它也抱怨 org.apache.activemq.util 不存在,但我指的是 activemq-all-5.1.0.jar。

note: all other references to external jars are working fine

注意:对外部罐子的所有其他引用都可以正常工作

any ideas?

有任何想法吗?

Edit: the jars needed to be referenced are

编辑:需要引用的罐子是

activemq-core-5.1.0.jar
geronimo-jms_1.1_spec-1.1.1.jar
commons-logging-1.1.jar
geronimo-j2ee-management_1.0_spec-1.0.jar

they're in the activemq binary dist in the lib folder

它们位于 lib 文件夹中的 activemq 二进制文件中

回答by James Strachan

In the lib directory are the jars you'll need to compile things. The JMS API is inside lib/geronimo-jms-1.1.jar.

在 lib 目录中是编译所需的 jars。JMS API 位于lib/geronimo-jms-1.1.jar 中

How are you trying to build them BTW? You using the Ant build that is there? See the documentation on building them.

顺便说一句,您打算如何构建它们?您使用的是那里的 Ant 构建?请参阅有关构建它们文档