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 /
locate
#install jzmq libraries and dependencies
RUN git clone htt://github.com/zeromq/libzmq.git
RUN cd libzmq && ./autogen.sh && ./configure --prefix=/ && make && make install && ldconfig
RUN wget http://download.zeromq.org/zeromq-3.1.0-beta.zip
RUN unzip zeromq-3.1.0-beta.zip
RUN cd zeromq-3.1.0 && ./configure --prefix=/ && make && make install && ldconfig
RUN git clone https://github.com/zeromq/jzmq.git
RUN cd jzmq/jzmq-jni && ./autogen.sh && ./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

Hey,
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(ClassLoader.java:1867) ~[na:1.8.0_212]
at java.lang.Runtime.loadLibrary0(Runtime.java:870) ~[na:1.8.0_212]
at java.lang.System.loadLibrary(System.java:1122) ~[na:1.8.0_212]
at org.apache.subversion.javahl.NativeResources.loadNativeLibrary(NativeResources.java:110) ~[javahl-1.11.0.jar!/:na]
at org.apache.subversion.javahl.SVNClient.(SVNClient.java:52) ~[javahl-1.11.0.jar!/:na]