Sign inSign up

stden/java-run-swing

By stden

•Updated 1 day ago

Run Java Swing applications and tests with JDK 25 LTS and a virtual display.

Image
Languages & frameworks
Developer tools
0

1.0K

stden/java-run-swing repository overview

⁠stden/java-run-swing

Run Java Swing applications and tests with JDK 25 LTS and a virtual display.

⁠Contents

  • OpenJDK 25 LTS on Alpine Linux
  • Xvfb and xvfb-run for a virtual display
  • DejaVu fonts
  • Tini to manage child processes

The working directory is /app. The default command starts /bin/sh. The virtual display runs inside the container. It does not show a window on your monitor.

⁠Tags

TagMeaningPlatform
latestLatest successful main buildlinux/amd64

View tags and image digests⁠.

⁠Pull and run

docker pull stden/java-run-swing:latest
docker run --rm stden/java-run-swing:latest java -version

Run a Swing JAR from the current directory:

docker run --rm -v "$PWD":/app stden/java-run-swing:latest \
  xvfb-run -a java -jar my-app.jar

Compile a Java source file named Hello.java. Then run the program:

docker run --rm -v "$PWD":/app stden/java-run-swing:latest javac Hello.java
docker run --rm -v "$PWD":/app stden/java-run-swing:latest xvfb-run -a java Hello

A test must close its windows and exit when it finishes.

⁠Checks and source

CI compiles a small Swing program, opens a JFrame under Xvfb, and checks its exit status.

Dockerfile⁠ · Docker tutorial⁠ · Build results⁠

Tag summary

Content type

Image

Digest

sha256:92677760d…

Size

277.4 MB

Last updated

1 day ago

docker pull stden/java-run-swing