I have a Java application that uses WebRenderer for a java headless browser. WebRenderer does not require xserver to run and I have confirmed this by uninstalling all x11 libs and xserver components.
However the problem is it throws an error: Gtk-WARNING **: cannot open display:
in certain conditions. Upon research I found that it usually throws that error with systems that have openJDK installed. Also when the current java version is from Sun but openJDK is still installed. To fix it I would need to uninstall libatk-wrapper-java
and libgtk2.0-0
(which also removes default-jre
, cedtea-netx
, libatk-wrapper-java-jni
, libgtk2.0-bin
, and openjdk-6-jre
).
It also throws the same error in openSUSE (with Java from Sun). Would there be any way to fix this error without having to start up xserver or uninstalling a bunch of components that could be required for something else? Any help is appreciated.
Yes, use Xvfb
.
In one terminal, you run Xvfb :1
. In the other terminal, you run DISPLAY=:1 ./yourapp
.
Some distros have a xvfb-run
script that does the magic of launching Xvfb
and your app on the same command.
http://en.wikipedia.org/wiki/Xvfb
Google for Xvfb
for more information
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With