Comments (11)
Mac OSX uses DYLD_LIBRARY_PATH instead of unix LD_LIBRARY_PATH
from jzmq.
I finally got it to work today! This is how, step-by-step:
I'm using MacPorts and am on Mac OS X 10.6.6. I have installed a current Xcode (and thus gcc and that stuff), as well as pkg-config using MacPorts.
First, I get and build zeromq2:
git clone git://github.com/zeromq/zeromq2.git
cd zeromq2 # current commit is 2970d6c30b1f57e9a75d46982378b103899bddbc
./autogen.sh && ./configure && make && sudo make install && echo ":: ALL OK ::"
cd ..
ls -al /usr/local/lib/libzmq.*
Output of 'ls -al':
-rwxr-xr-x 1 root wheel 348920 Mar 14 13:14 /usr/local/lib/libzmq.1.dylib
-rw-r--r-- 1 root wheel 6306760 Mar 14 13:14 /usr/local/lib/libzmq.a
lrwxr-xr-x 1 root wheel 14 Mar 14 13:14 /usr/local/lib/libzmq.dylib -> libzmq.1.dylib
-rwxr-xr-x 1 root wheel 912 Mar 14 13:14 /usr/local/lib/libzmq.la
Then, I get and build jzmq:
git clone git://github.com/zeromq/jzmq.git
cd jzmq # current commit is 522d7474effe8c96dfaece51e739eda9189bad45
export JAVA_HOME="$(/usr/libexec/java_home)" # /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
./autogen.sh && ./configure && make && sudo make install && echo ":: ALL OK ::"
cd ..
ls -al /usr/local/lib/*jzmq* /usr/local/share/java/*zmq*
Output of 'ls -al':
-rwxr-xr-x 1 root wheel 27600 Mar 14 13:42 /usr/local/lib/libjzmq.0.dylib
-rw-r--r-- 1 root wheel 279448 Mar 14 13:42 /usr/local/lib/libjzmq.a
lrwxr-xr-x 1 root wheel 15 Mar 14 13:42 /usr/local/lib/libjzmq.dylib -> libjzmq.0.dylib
-rwxr-xr-x 1 root wheel 943 Mar 14 13:42 /usr/local/lib/libjzmq.la
-rw-r--r-- 1 root wheel 10268 Mar 14 13:42 /usr/local/share/java/zmq.jar
Then, I build and run HelloWorldClient.java:
javac -classpath /usr/local/share/java/zmq.jar HelloWorldClient.java
java -classpath .:/usr/local/share/java/zmq.jar -Djava.library.path=/usr/local/lib HelloWorldClient
This client runs, and I can now e.g. start a server or communicate interactively using a Python console with PyZMQ.
from jzmq.
I've also tried:
mvn clean install
But both the included tests also fail with UnsatisfiedLinkError.
from jzmq.
mvn -version -> 2.2.1
from jzmq.
I don't use (nor have I ever used) OSX. But let's assume it is just another flavor of Linux (I mean, Unix). The jzmq JAR (zmq.jar) requires two other components to work properly: the native 0MQ shared library (libzmq.so), the same thing used by any regular C/C++ program, and a bridge shared library (jzmq.so) that allows the Java 0MQ classes to interface with the native 0MQ shared library.
With that out of the way, I would try the following:
- Put zmq.jar, jzmq.so and libzmq.so in a place that you are POSITIVE will make things work. I am thinking of /usr/local/lib or even /usr/lib. Make sure a minimal test program actually does work.
- Once that works, move things to your CWD and try the same minimal program there.
- One that works, move things to wherever you really want to put them, and make that work.
Apologies if these instructions seem too basic; this is really the way I would approach diagnosing this. Please let me know how it goes.
from jzmq.
I've found this link http://blog.pmorelli.com/getting-zeromq-and-jzmq-running-on-mac-os-x in discussion for issue 6 https://github.com/zeromq/jzmq/issues/closed#issue/6
Maybe it will help you.
from jzmq.
Felix, have you had any progress? I am trying to close issues that have already been solved.
from jzmq.
gonzus: Thanks for responding! I will report back in the next few days with more details, following your checklist. Please give me another week or so, I've already been trying three times over the course of a month to get this to work without success.
abelaska: I think I've looked at pretty much everything that Google gave me for "jzmq osx", but I'll have another look at that link to check that I haven't forgotten anything. I think I've got the pkg-config and Java Development Kit parts right though.
I will install it all again and come back with more detailed notes.
from jzmq.
Felix, this is great news. Perhaps you could add this documentation to the proper section in http://www.zeromq.org/docs:tuning-zeromq (I think that is the proper place). Thanks for the update.
from jzmq.
Gonzus, thanks for the feedback. Feel free to add a link to this issue there, as I don't have an account there.
By the way, HelloWorldClient.java mentioned above is https://github.com/imatix/zguide/blob/609b4255d87287a42932392db1d50256c1b878ae/examples/Java/hwclient.java
from jzmq.
As a note:
On Mac, I found that I prefer using Homebrew over MacPorts, as many of the ports are stale.
Cheers.
from jzmq.
Related Issues (20)
- error: illegal character: '\u00a0' HOT 2
- Error while executing mvn package HOT 1
- facing Event issue in Event.cpp file
- ZLoop synchronization
- IPC with unix domain socket no communication HOT 3
- JZMQ have Client-server pattern?ZMQ.CLIENT & ZMQ.SERVER?
- During build process crashes on make execution
- Java process memory consumption.
- Support for RADIO/DISH + join/leave group methods missing
- javac: invalid flag: -h
- More paths should be added to .gitignore
- No ZFrame or ZMsg in zmq.jar
- GPL or LGPL Licensing? HOT 1
- Android jzmq Support
- mvn package fails
- test fails on apple m1 chip using openjdk8
- Memory leak zmq msg_t initsize ?
- why do you use ZeroMQ HOT 1
- connected but can not receive msgs in pair-pair pattern
- IPC between Python and Java
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jzmq.