Run Java Swing applications and tests with JDK 25 LTS and a virtual display.
1.0K
Run Java Swing applications and tests with JDK 25 LTS and a virtual display.
xvfb-run for a virtual displayThe 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.
| Tag | Meaning | Platform |
|---|---|---|
latest | Latest successful main build | linux/amd64 |
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.
CI compiles a small Swing program, opens a JFrame under Xvfb, and checks its exit status.
Content type
Image
Digest
sha256:92677760d…
Size
277.4 MB
Last updated
1 day ago
docker pull stden/java-run-swing