From owner-freebsd-java@FreeBSD.ORG Wed Feb 2 08:56:47 2011 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA93C1065672 for ; Wed, 2 Feb 2011 08:56:47 +0000 (UTC) (envelope-from achill@matrix.gatewaynet.com) Received: from smadev.internal.net (host3.dynacom.ondsl.gr [62.103.35.211]) by mx1.freebsd.org (Postfix) with ESMTP id 104D48FC12 for ; Wed, 2 Feb 2011 08:56:46 +0000 (UTC) Received: from smadev.internal.net (localhost.internal.net [127.0.0.1]) by smadev.internal.net (8.14.2/8.14.2) with ESMTP id p128io6f050241 for ; Wed, 2 Feb 2011 10:44:50 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) Received: from localhost (localhost [[UNIX: localhost]]) by smadev.internal.net (8.14.2/8.14.2/Submit) id p128inMp050240 for freebsd-java@freebsd.org; Wed, 2 Feb 2011 10:44:49 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) From: Achilleas Mantzios Organization: Dynacom Tankers Mgmt To: freebsd-java@freebsd.org Date: Wed, 2 Feb 2011 10:44:48 +0200 User-Agent: KMail/1.9.7 References: <4D490AC0.5080905@aldan.algebra.com> In-Reply-To: <4D490AC0.5080905@aldan.algebra.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201102021044.49408.achill@matrix.gatewaynet.com> Subject: Re: image-manipulation in Java without X11 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Feb 2011 08:56:47 -0000 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.(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