This lib (jzmq) is binding to the native library libzmq.
If you don't use features of libzmq (ipc for example) you'd better to use full java implementation - jeromq (mvnrepo, jeromq git). It has almost the same functionality.
Otherwise if you need jzmq, you have to compile it properly.
This is the way i compiled it on windows x64:
To build the library you need IDE Visual Studio 2010 or higher. In this example i used 2013 version. All work is performed in the directory C:\zmq
(for example).
- Get the zeromq, jzmq and libsodium-1.0.10 sources.
- Copy the entire contents of zeromq directory to
C:\zmq
.
- Create a directory
C:\zmq\java
.
- Copy the entire contents of jzmq directory to
C:\zmq\java
.
- Create a directories
C:\zmq\libsodium
and C:\zmq\libsodium
- Copy to
C:\zmq\libsodium\bi
n libsodium-1.0.10-msvc\Win32
and
libsodium-1.0.10-msvc\x64
directories.
- Create a directory
C:\zmq\libsodium\src
.
- Copy to
C:\zmq\libsodium\src directory
libsodium-1.0.10-msvc\include.
Zeromq.
Open in Visual Studio the appropriate zeromq solution file from the directory C:\zmq\builds\msvc
.
Open configuration manager. Active configuration solutions - choose DynRelease. Active solution platform - choose x64.
Open project properties page, go to Configuration Properties - C/C++ - General, check paths for include files directories.
Then select linker - General, and check paths for the libraries directories.
In the configuration file C:\zmq\builds\msvc\vs2013\libsodium.import.props
correct path in the section.
Then buid it, if all was correct you will get dlls in C:\zmq\bin\x64\Release\v120\dynamic
directory. If it wasn't - check out logs, make changes and rebuild it.
Jzmq.
Now open the appropriate jzmq solution file from the directory C:\zmq\java\builds\msvc\
As well as in zeromq project open configuration manager and select Release and x64 platform.
Open project properties page, go to Configuration Properties - VC ++ Directories and check that path where your JDK was installed is correct.
You will se there something like this:
..\..\..\..\include;C:\Program Files\Java\jdk1.7.0_71\include;C:\Program
Files\Java\jdk1.7.0_71\include\win32;$(IncludePath)
Also check that Library Catalogues (forgot its name) path include path to the directory with built zeromq libs.
It will look like this:
..\..\..\..\bin\x64\Release\v120\dynamic;$(LibraryPath)
On the properties page, go to Configuration Properties - assembly events - event before assembly and check property "Command Prompt" (first of all check paths to files in copy command).
It will look like this:
copy ..\config.hpp "..\..\..\src\main\c++\"
Then buid jzmq, if all was correct you will get files in C:\zmq\java\lib
.
If it wasn't - check out logs, make changes and rebuild it.
In the C:\zmq
you need only bin java\lib
directories, the rest can be removed.
Add to PATH the path to bin\x64\Release\v120\dynamic
and run you java app with -Djava.library.path="path_to_java\lib"