Docker Community Forums

Share and learn in the Docker community.

Getting java.lang.UnsatisfiedLinkError: no jzmq in java.library.path

Hi Guys,

I’m completely new to Docker and I just started a small Docker-project. My goal is to dockerize a small game I wrote in Java. My game has a server and a client-side which use ZMQ for the connection.
I now worked on my Dockerfile quite a while to get the neccessary libraries like zmq and jzmq installed.

The problem i now ran into ist the following: building the Dockerfile gets me into this error:

I’ve googled this specific error for some time but no solution provided there worked for me (e.g. specifically provide the java lib path by adding -DJava… to the run command).

Here’s my Dockerfile:

#set up build environment
FROM maven:3.6.2-jdk-11 AS MAVEN_TOOL_CHAIN
COPY pom.xml /home/myshipgame/
COPY /src/ /home/myshipgame/src
COPY settings.xml /usr/share/maven/ref/
WORKDIR /home/myshipgame
RUN mvn -s /usr/share/maven/ref/settings.xml clean package
#install neccessary tools
RUN apt-get update && apt-get upgrade -y && apt-get install -y /
make /
unzip /
build-essential /
pkg-config /
libtool /
autoconf /
automake /
libzmq3-dev /
#install jzmq libraries and dependencies
RUN git clone htt://
RUN cd libzmq && ./ && ./configure --prefix=/ && make && make install && ldconfig
RUN wget
RUN unzip
RUN cd zeromq-3.1.0 && ./configure --prefix=/ && make && make install && ldconfig
RUN git clone
RUN cd jzmq/jzmq-jni && ./ && ./configure --prefix=/ && make && make install && ldconfig
#run game-server
FROM openjdk:latest
EXPOSE 12345 12345
COPY --from=MAVEN_TOOL_CHAIN /home/myshipgame/target/myshipgame-0.1.jar /lib/shipgame.jar
RUN java -jar /lib/shipgame.jar -port 12345 -seed 123 -timeout -1 -map testmap.json

Please feel free to criticize the Dockerfile or give me some tips (as I said, I’m completely new to Docker).

Anyone here that know what I have to do to get this thing up and running?
(Just for you to know: I installed all libraries on a local Ubuntu machine and the .jar file works properly)

My system: OS Ubuntu Server 18.04 LTS
Docker version: 18.09.9

Best Regards

I resolved the issue by now. I had to user another base-image in order to get the libraries to install properly :slight_smile:

Can you please help with the steps? I am facing the below error.

java.lang.UnsatisfiedLinkError: no svnjavahl-1 in java.library.path
at java.lang.ClassLoader.loadLibrary( ~[na:1.8.0_212]
at java.lang.Runtime.loadLibrary0( ~[na:1.8.0_212]
at java.lang.System.loadLibrary( ~[na:1.8.0_212]
at org.apache.subversion.javahl.NativeResources.loadNativeLibrary( ~[javahl-1.11.0.jar!/:na]
at org.apache.subversion.javahl.SVNClient.( ~[javahl-1.11.0.jar!/:na]