Java binding

Source Code

http://github.com/zeromq/jzmq

Build and installation

UNIX-like platforms

Get the source code, then do the following:

$ autogen.sh
$ configure
$ make
$ make install

On Linux you must run the ldconfig command as root after running make install to ensure that the system library cache is updated.

Make sure that you have set the Java classpath to the directory where ØMQ classes reside.

Finally, for Java to find the libzmq and libjzmq shared libraries you must ensure that java.library.path is set to the directory where these are installed (normally /usr/local/lib on UNIX-like systems).

Example command line for running a Java test program on Linux:

$ java -Djava.library.path=/usr/local/lib -classpath /home/user/zeromq/libjzmq/:./local_lat tcp://127.0.0.1:5555 1 100

Windows

Get the source code, then use MSVC (2008 or later) to open the solution file builds\msvc\msvc.sln and build the projects.

Note that ØMQ and JDK header file has to be on "include path" (Tools|Options|Projects and Solutions|VC++ Directories|Include files) and ØMQ libraries have to be on "library path" (Tools|Options|Projects and Solutions|VC++ Directories|Library files):

Include files:
    <jdk>\include\win32
    <jdk>\include
    <zeromq>\include

Library files:
    <zeromq>\lib

To run it, firstly check whether libzmq.dll is on the system PATH. Secondly, make sure that you have set the Java classpath to the directory where ØMQ classes reside. Thirdly, for Java to find the jzmq.dll shared library you must ensure that java.library.path is set to the directory where it is installed.

Example command to run Java test program on Windows:

$ set PATH=%PATH%;c:\zmq\bin
$ java -Djava.library.path=c:\zmq\java -classpath c:\zmq\java;.\local_lat tcp://127.0.0.1:5555 1 100

Bug Reporting

http://github.com/zeromq/jzmq/issues

Mailing list

gro.qmorez.stsil|ved-qmorez#gro.qmorez.stsil|ved-qmorez

Page tags: java