'Unable to use java in docker container
I am trying to use dask-sql in my python code which needs JAVA in the docker container. this is my docker file
RUN apk update
RUN apk add make automake gcc g++ subversion python3-dev
RUN apk add openjdk11
ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk/
RUN export JAVA_HOME
RUN export LD_LIBRARY_PATH=/usr/lib/jvm/java-11-openjdk/lib/libjava.so:/usr/lib/jvm/java-11-openjdk/lib/server/libjvm.so
this is the code in my python file
from dask_sql import Context
c = Context()
print(c.sql('''some SQL query''')
but I am getting below error while running the code An error occurred during the initialization of the VM Unable to load native library: Error loading shared library libjvm.so: No such file or directory (needed by /usr/lib/jvm/java-11-openjdk/lib/libjava.so)
This is the actual path for both these files:
bash-5.1# find / -name libjava.so
/usr/lib/jvm/java-11-openjdk/lib/libjava.so
bash-5.1# find / -name libjvm.so
/usr/lib/jvm/java-11-openjdk/lib/server/libjvm.so
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
