Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Feb 2011 10:44:48 +0200
From:      Achilleas Mantzios <achill@matrix.gatewaynet.com>
To:        freebsd-java@freebsd.org
Subject:   Re: image-manipulation in Java without X11
Message-ID:  <201102021044.49408.achill@matrix.gatewaynet.com>
In-Reply-To: <4D490AC0.5080905@aldan.algebra.com>
References:  <4D490AC0.5080905@aldan.algebra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
try
java -Djava.awt.headless=3Dtrue=20

=CE=A3=CF=84=CE=B9=CF=82 Wednesday 02 February 2011 09:41:52 =CE=BF/=CE=B7 =
Mikhail T. =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5:
> Hello!
>=20
> I'm trying to port a Java-application, which sometimes needs to process=20
> (get dimensions, possibly -- resize) a few images. Whenever it does=20
> this, it needs a valid $DISPLAY in the environment, otherwise an=20
> exception like this is thrown:
>=20
>     |java.lang.InternalError: Can't connect to X11 window server using
>     ':0.0' as the value of the DISPLAY variable.
>              at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
>              at
>     sun.awt.X11GraphicsEnvironment.access$100(X11GraphicsEnvironment.java=
:52)
>              at
>     sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:155)
>              at java.security.AccessController.doPrivileged(Native Method)
>              at
>     sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:1=
31)
>              at java.lang.Class.forName0(Native Method)
>              at java.lang.Class.forName(Class.java:169)
>              at
>     java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvi=
ronment.java:68)
>              at
>     java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1135)
>     |
>=20
> Apparently, the first thing AWT is doing is initialize X11 -- even if it=
=20
> is not going to need X11 for anything... This makes the program (almost)=
=20
> unusable as a daemon...
>=20
> I wonder if it is possible to a) make AWT a little smarter in this=20
> regard -- even if only on FreeBSD; or b) do image-processing in Java=20
> using some other classes?..
>=20
> Thanks! Yours,
>=20
>     -mi
>=20
> ||
> _______________________________________________
> freebsd-java@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-java
> To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"
>=20



=2D-=20
Achilleas Mantzios



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102021044.49408.achill>