You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rodrigo Avila <rd...@gmail.com> on 2005/02/04 17:57:40 UTC

java.awt.headless=true in tomcat startup

Hi!
I try to use some awt\swing classes to convert rtf strings to html in
an jsp page. But I receive the following Exception:

"Can't connect to X11 window server using ':0.0' as the value of the
DISPLAY variable."

But, to resolve this problem, I find the following tip:

"assuming you're using a 1.4 JVM, add the following line to your startup
command:
$JAVA_COMMAND -Djava.awt.headless=true ..."

But, how I put this option in the Tomcat startup?

-- 
Rodrigo de Avila
rdeavila@gmail.com

http://www.avila.eti.br

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: java.awt.headless=true in tomcat startup

Posted by Filip Hanik - Dev <de...@hanik.com>.
put it in the /bin/catalina.sh script

Filip

----- Original Message ----- 
From: "Rodrigo Avila" <rd...@gmail.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, February 04, 2005 10:57 AM
Subject: java.awt.headless=true in tomcat startup


Hi!
I try to use some awt\swing classes to convert rtf strings to html in
an jsp page. But I receive the following Exception:

"Can't connect to X11 window server using ':0.0' as the value of the
DISPLAY variable."

But, to resolve this problem, I find the following tip:

"assuming you're using a 1.4 JVM, add the following line to your startup
command:
$JAVA_COMMAND -Djava.awt.headless=true ..."

But, how I put this option in the Tomcat startup?

-- 
Rodrigo de Avila
rdeavila@gmail.com

http://www.avila.eti.br

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: java.awt.headless=true in tomcat startup

Posted by Larry Meadors <la...@gmail.com>.
no no no - it should go in setenv.sh - that is what it is for - that
way you do not have to tweak the existing files.


On Fri, 04 Feb 2005 12:04:36 -0500, Charles N. Harvey III
<ch...@alloy.com> wrote:
> You set this somewhere in either the <tomcat-home>/bin/catalina.sh
> or <tomcat-home>/bin/startup.sh.
> 
> If you don't want to do any of that, have an InitServlet that does
> 
> System.setProperty( "java.awt.headless", true );
> 
> That will do the same thing.
> 
> Charlie
> 
> Rodrigo Avila said the following on 2/4/2005 11:57 AM:
> 
> >Hi!
> >I try to use some awt\swing classes to convert rtf strings to html in
> >an jsp page. But I receive the following Exception:
> >
> >"Can't connect to X11 window server using ':0.0' as the value of the
> >DISPLAY variable."
> >
> >But, to resolve this problem, I find the following tip:
> >
> >"assuming you're using a 1.4 JVM, add the following line to your startup
> >command:
> >$JAVA_COMMAND -Djava.awt.headless=true ..."
> >
> >But, how I put this option in the Tomcat startup?
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: java.awt.headless=true in tomcat startup

Posted by "Charles N. Harvey III" <ch...@alloy.com>.
You set this somewhere in either the <tomcat-home>/bin/catalina.sh
or <tomcat-home>/bin/startup.sh.

If you don't want to do any of that, have an InitServlet that does

System.setProperty( "java.awt.headless", true );

That will do the same thing.


Charlie


Rodrigo Avila said the following on 2/4/2005 11:57 AM:

>Hi!
>I try to use some awt\swing classes to convert rtf strings to html in
>an jsp page. But I receive the following Exception:
>
>"Can't connect to X11 window server using ':0.0' as the value of the
>DISPLAY variable."
>
>But, to resolve this problem, I find the following tip:
>
>"assuming you're using a 1.4 JVM, add the following line to your startup
>command:
>$JAVA_COMMAND -Djava.awt.headless=true ..."
>
>But, how I put this option in the Tomcat startup?
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: java.awt.headless=true in tomcat startup

Posted by Jens Joachim <je...@syscon-world.de>.
Hi Rodrigo!

By defining the environment variable
CATALINA_OPTS="-server -Djava.awt.headless=true"
you can tell any command line parameter you want to the JVM used by tomcat.

I suggest it is a good idea to use the "-server" parameter, too. This
selects the server VM.

Jens Joachim
Syscon GmbH
E-Mail: Jens.Joachim@syscon-world.de

----- Original Message -----
From: "Rodrigo Avila" <rd...@gmail.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, February 04, 2005 5:57 PM
Subject: java.awt.headless=true in tomcat startup


> Hi!
> I try to use some awt\swing classes to convert rtf strings to html in
> an jsp page. But I receive the following Exception:
>
> "Can't connect to X11 window server using ':0.0' as the value of the
> DISPLAY variable."
>
> But, to resolve this problem, I find the following tip:
>
> "assuming you're using a 1.4 JVM, add the following line to your startup
> command:
> $JAVA_COMMAND -Djava.awt.headless=true ..."
>
> But, how I put this option in the Tomcat startup?
>
> --
> Rodrigo de Avila
> rdeavila@gmail.com
>
> http://www.avila.eti.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org