### Off-screen Rendering Exception Example Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjre-alpine-musl/README.md This is an example of an exception that may occur during off-screen rendering when OS fonts and fontconfig libraries are missing. ```shell Exception in thread "main" java.lang.InternalError: java.lang.reflect.InvocationTargetException at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:86) at java.base/java.security.AccessController.doPrivileged(AccessController.java:312) at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) at java.desktop/sun.font.SunFontManager.getInstance(SunFontManager.java:247) at java.desktop/sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:261) at java.desktop/sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1243) ... at jdk.compiler/com.sun.tools.javac.launcher.Main.run(Main.java:192) at jdk.compiler/com.sun.tools.javac.launcher.Main.main(Main.java:132) Caused by: java.lang.NullPointerException at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262) at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225) at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107) at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719) at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:362) at java.base/java.security.AccessController.doPrivileged(AccessController.java:312) at java.desktop/sun.font.SunFontManager.(SunFontManager.java:307) at java.desktop/sun.awt.FcFontManager.(FcFontManager.java:35) at java.desktop/sun.awt.X11FontManager.(X11FontManager.java:56) ... 28 more ``` -------------------------------- ### Run Liberica OpenJDK 17 Container Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjdk-rocky/README.md Execute a Liberica OpenJDK 17 container and display the Java version. This is a basic example to verify the image. ```bash docker run -it --rm bellsoft/liberica-openjdk-rocky:17 java -version ``` -------------------------------- ### Install Font Packages on Alpine Linux Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjre-alpine-musl/README.md Install the necessary fontconfig and ttf-dejavu packages on Alpine Linux to resolve off-screen rendering issues. This command uses the apk package manager. ```shell apk add fontconfig ttf-dejavu ``` -------------------------------- ### Run Liberica OpenJDK Container Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjdk-alpine-musl/README.md Run a Liberica OpenJDK container to check the Java version. This command starts an interactive, temporary container and prints the Java version. ```bash docker run -it --rm bellsoft/liberica-openjdk-alpine-musl:latest java -version ``` -------------------------------- ### Run Application with Mounted Volume Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjdk-rocky/README.md Execute a Liberica OpenJDK container, mount a local directory containing an application JAR, and run the application. This demonstrates how to deploy applications within the container. ```bash docker run -it --rm -v /home/user/project/:/data bellsoft/liberica-openjdk-rocky:latest java -jar /data/MyApp.jar ``` -------------------------------- ### Run Application with Mounted Volume Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjre-debian/README.md Use this command to run a Java application packaged as a JAR file. It mounts a local directory containing the application into the container and executes it. ```bash docker run -it --rm -v /home/user/project/:/data bellsoft/liberica-openjre-debian:8u272 java -jar /data/MyApp.jar ``` -------------------------------- ### Run Application with Mounted Volume Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjdk-alpine/README.md This command shows how to run a Java application from a mounted volume using the Liberica OpenJDK Alpine image. ```bash docker run -it --rm -v /home/user/project/:/data bellsoft/liberica-openjdk-alpine:latest java -jar /data/MyApp.jar ``` -------------------------------- ### Run Application with Mounted Volume Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjre-centos/README.md This command shows how to run an application (MyApp.jar) from a mounted volume within a Liberica OpenJRE container. ```bash docker run -it --rm -v /home/user/project/:/data bellsoft/liberica-openjre-centos:8u272 java -jar /data/MyApp.jar ``` -------------------------------- ### Build Docker Image with Optional Packages Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjre-alpine/README.md Build a Liberica JDK Docker image, specifying optional packages like fontconfig and ttf-dejavu for off-screen rendering. ```shell docker build -t bellsoft/liberica-openjre-alpine:8u242 \ --build-arg LIBERICA_RELEASE_TAG=8u272+10 \ --build-arg LIBERICA_VERSION=8u272 \ --build-arg LIBERICA_BUILD=7 \ --build-arg LIBERICA_VARIANT=jre \ --build-arg LIBERICA_ROOT=/usr/lib/jvm/jre-8u272-bellsoft-x86_64 \ --build-arg OPT_PKGS="fontconfig ttf-dejavu" ``` -------------------------------- ### Run Application with Mounted Volume Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjre-alpine/README.md Execute a Liberica OpenJRE Alpine container and run a Java application from a mounted volume. ```shell docker run -it --rm -v /home/user/project/:/data bellsoft/liberica-openjre-alpine:8u272 java -jar /data/MyApp.jar ``` -------------------------------- ### Run Latest Liberica OpenJDK 17 Container Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjdk-alpine/README.md This command demonstrates how to run the latest Liberica OpenJDK 17 container and check its version. ```bash docker run -it --rm bellsoft/liberica-openjdk-alpine:latest java -version ``` -------------------------------- ### Build Dockerfile with Optional Packages Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjre-alpine-musl/README.md Build the Liberica JDK Docker image with additional packages like fontconfig and ttf-dejavu by specifying the OPT_PKGS build argument. This ensures off-screen rendering capabilities. ```shell docker build -t bellsoft/liberica-openjre-alpine-musl:8u272 \ --build-arg LIBERICA_RELEASE_TAG=8u272+10 \ --build-arg LIBERICA_VERSION=8u272 \ --build-arg LIBERICA_BUILD=10 \ --build-arg LIBERICA_VARIANT=jre \ --build-arg LIBERICA_ROOT=/usr/lib/jvm/jre-8u272-bellsoft-x86_64 \ --build-arg OPT_PKGS="fontconfig ttf-dejavu" ``` -------------------------------- ### Build Custom Liberica OpenJDK Alpine Image Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjdk-alpine-musl/README.md Build a custom Liberica OpenJDK Alpine Linux musl image. Choose the image variant using the --build-arg LIBERICA_IMAGE_VARIANT parameter. ```bash curl https://raw.githubusercontent.com/bell-sw/Liberica/master/docker/repos/liberica-openjdk-alpine-musl/17/Dockerfile --output Dockerfile docker build . --build-arg LIBERICA_IMAGE_VARIANT=[standard|lite|base|base-minimal] ``` -------------------------------- ### Run Application in Liberica OpenJDK Container Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjdk-alpine-musl/README.md Execute an application within a Liberica OpenJDK container by mounting a local directory. This mounts the host's /home/user/project/ directory to the container's /data volume and runs MyApp.jar. ```bash docker run -it --rm -v /home/user/project/:/data bellsoft/liberica-openjdk-alpine-musl:latest java -jar /data/MyApp.jar ``` -------------------------------- ### Run Liberica OpenJRE 8u432 Container Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjre-rocky/README.md Execute a Liberica OpenJRE 8u432 container to check the Java version. This command runs the container interactively, removes it upon exit, and executes the 'java -version' command. ```bash docker run -it --rm bellsoft/liberica-openjre-rocky:8u432 java -version ``` -------------------------------- ### Run Application in Liberica OpenJRE Container Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjre-rocky/README.md Run a Java application (MyApp.jar) within a Liberica OpenJRE Rocky container by mounting a local directory. This command mounts the host's '/home/user/project/' to the container's '/data' and executes the application. ```bash docker run -it --rm -v /home/user/project/:/data bellsoft/liberica-openjre-rocky:8u432 java -jar /data/MyApp.jar ``` -------------------------------- ### Run Liberica OpenJRE 8u272 Container Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjre-centos/README.md This command demonstrates how to run a specific version of the Liberica OpenJRE container and check its Java version. ```bash docker run -it --rm bellsoft/liberica-openjre-centos:8u272 java -version ``` -------------------------------- ### Run Liberica OpenJDK 17 Container Source: https://github.com/bell-sw/liberica/blob/master/docker/repos/liberica-openjdk-debian/README.md Execute a Liberica OpenJDK 17 container to check its Java version. This command runs the latest tag of the image interactively, removes the container upon exit, and executes `java -version`. ```bash docker run -it --rm bellsoft/liberica-openjdk-debian:latest java -version ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.