简体   繁体   English

Java Path zeromq设置

[英]Java Path zeromq setting

I am using MAC OSX 我正在使用MAC OSX

I already follow the instruction on 0mq official site to install 我已经按照0mq官方网站上的说明进行安装

when i compile it , i dont get any error. 当我编译它时,我没有任何错误。

But when i run the following command 但是当我运行以下命令时

java -classpath /Users/john/jzmq/ -cp $(lein classpath) storm.starter.WordCountTopology

I got the following error. 我收到以下错误。

java.lang.UnsatisfiedLinkError: no jzmq in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1878)
    at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1087)
at org.zeromq.ZMQ.<clinit>(ZMQ.java:34)
at storm.starter.spout.RandomSentenceSpout.nextTuple(RandomSentenceSpout.java:39)
at backtype.storm.daemon.executor$fn__3985$fn__3997$fn__4026.invoke(executor.clj:502)
at backtype.storm.util$async_loop$fn__465.invoke(util.clj:377)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:724)

My setting $ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home 我的设置$ echo $ JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home

I also have zmq.jar under 我也有zmq.jar
/usr/local/lib and / usr / local / lib和

/usr/local/share/java 在/ usr / local / share下/ JAVA

I read through all the google search I can found. 我仔细阅读了所有可以找到的Google搜索。 Still no crew why my one is not working 仍然没有船员为什么我的一个人不工作

In addition to setting the JAR classpath, you need to specify where the jzmq .so library files reside. 除了设置JAR类路径外,还需要指定jzmq .so库文件所在的位置。 Did you build zmq, libzmq, and jzmq exactly as described in the directions? 您是否按照说明中的说明完全构建了zmq,libzmq和jzmq? If so, you should see the .so library files in /usr/local/lib and zmq.jar in /usr/local/share/java , confirm that, then logout/login based on this , then try this: 如果是这样,您应该在/usr/local/lib看到.so库文件,在/usr/local/share/java zmq.jar ,确认,然后基于注销/登录,然后尝试以下操作:

java -Djava.library.path=/usr/local/lib -cp  "/usr/local/share/java/zmq.jar:/Users/john/jzmq/<your jar here>" storm.starteer.WordCountTopology

Hope it helps 希望能帮助到你

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

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