Studio doesn't work with OpenJDK

Hi,

because of the question by Eugene i tried to get studio running on Docker. What i did was something like this where my base image is the official java docker image:

FROM java:8-jdk
ADD studio-2.0.6 /usr/local/bin/studio/
ENV STUDIO_OPTS '-Dstudio.connection.remote.enable=true'
CMD /usr/local/bin/studio/bin/studio



Running this results in a Caused by: java.lang.ClassNotFoundException: javafx.application.Application. This is due to the fact that the official Java Docker image uses OpenJDK. This image doesn’t include Java FX libraries.

When using Oralce JDK instead with some random image like isuper/java-oracle:jdk_8
it works.

What i just wondered about is, that if studio is running in headless mode, why there is even a need for java fx at all?

Bye,
Mario

Hi Mario,
Thank you for interesting question.
For now Studio does not work with Debian package of OpenJDK because it does not include JavaFX/OpenFX. We plan to improve compatibility with Debian OpenJDK in -nogui mode in one of the next Studio releases.

There is a way to run Studio with an official java base image. You need to install a openjfx package, so your dockerfile will look like this:


FROM java:8
RUN apt-get update && \
    apt-get install -y openjfx
COPY studio /usr/local/studio
ENV STUDIO_OPTS '-Dstudio.connection.remote.enable=true'
ENTRYPOINT ["/usr/local/studio/bin/studio"]
CMD ["-nogui"]
2 Likes

hi max,

thanks for the hint. I already read about the openjfx debian package but haven’t tried it…

Nevertheless my question was more about why javaFX at all when we put “-nogui” on it :slight_smile:

The only reason Studio requires JavaFx is Studio is run by one main class that, unfortunately, contains imports of JavaFx packages. We are planning to solve this problem a little bit later.

Have this issue been solved? Considering that now ORACLE will use licensing on ORACLE JDK, I think we need to start to think about using OpenJDK for our own good.

Hi,

You can run Studio on OpenJDK in headless mode using -nogui command line parameter. It will work without options dialog. Also you can install openjfx package as mentioned above and it will work.

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/STUDIO-2527