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=true 

Στις Wednesday 02 February 2011 09:41:52 ο/η Mikhail T. έγραψε:
> Hello!
> 
> I'm trying to port a Java-application, which sometimes needs to process 
> (get dimensions, possibly -- resize) a few images. Whenever it does 
> this, it needs a valid $DISPLAY in the environment, otherwise an 
> exception like this is thrown:
> 
>     |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:131)
>              at java.lang.Class.forName0(Native Method)
>              at java.lang.Class.forName(Class.java:169)
>              at
>     java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
>              at
>     java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1135)
>     |
> 
> Apparently, the first thing AWT is doing is initialize X11 -- even if it 
> is not going to need X11 for anything... This makes the program (almost) 
> unusable as a daemon...
> 
> I wonder if it is possible to a) make AWT a little smarter in this 
> regard -- even if only on FreeBSD; or b) do image-processing in Java 
> using some other classes?..
> 
> Thanks! Yours,
> 
>     -mi
> 
> ||
> _______________________________________________
> 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"
> 



-- 
Achilleas Mantzios



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