|
From: Lars S. <Lar...@if...> - 2009-11-10 08:36:00
|
Hi I would like to have my application which is started as a Linux daemon to present a graphical user interface to the user. The user interface is written in Java Swing. When I try to start the user interface I get an java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it. Is there a solution to this? Thanks in advance! Lars |
|
From: Lars S. <Lar...@if...> - 2009-11-26 08:06:16
|
Hi again I guess since there haven't been any replies to this problem, that there is no solution? Lars Lars Schnoor wrote: > Hi > I would like to have my application which is started as a Linux daemon > to present a graphical user interface to the user. The user interface is > written in Java Swing. > When I try to start the user interface I get an > java.awt.HeadlessException: > No X11 DISPLAY variable was set, but this program performed an operation > which requires it. > Is there a solution to this? > Thanks in advance! > > Lars > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Wrapper-user mailing list > Wra...@li... > https://lists.sourceforge.net/lists/listinfo/wrapper-user > |
|
From: Leif M. <le...@ta...> - 2009-11-26 08:36:42
|
Lars, I am very sorry for the delay on this. I discussed this with the team a couple weeks ago and was under the impression it had been replied to. The problem here is that Java decides where to display its GUI by looking at the DISPLAY environment variable. That DISPLAY environment variable does not and can not exist when a daemon process is launched on startup. It will be set in any environments that are created from within the X Windows environment, or which are set manually after the Window manager has been started. If the Wrapper launches the JVM before the Window manager is launched and a user has logged in, then the JVM will already exist with an environment that does not have a DISPLAY variable. It might be possible to get this working if the Wrapper sets the DISPLAY variable and you force a restart of the JVM whenever a user logs in. I will have to test that a bit more. Is this something that would make sense for your application? One solution that I have seen implemented in the past is to have one JVM which is running as a Daemon work horse. Then you launch a second JVM whenever the user logs in that is in charge of the user interface within the window environment. You could then use any number of technologies to communicate between the two JVMs. The GUI JVM would terminate when the user logged out We were talking about coming up with a recommended methodology for setting up systems like this. Starting with Windows Vista, it is no longer possible to have true interactive services, so we need to provide another solution to Windows users as well. I am interested in your feedback on what will and won't work for you, as well as what exactly you are hoping to be able to do and why. Once again sorry for the long delay. Cheers, Leif On Thu, Nov 26, 2009 at 5:05 PM, Lars Schnoor <Lar...@if...> wrote: > Hi again > I guess since there haven't been any replies to this problem, that there > is no solution? > > Lars > > Lars Schnoor wrote: >> Hi >> I would like to have my application which is started as a Linux daemon >> to present a graphical user interface to the user. The user interface is >> written in Java Swing. >> When I try to start the user interface I get an >> java.awt.HeadlessException: >> No X11 DISPLAY variable was set, but this program performed an operation >> which requires it. >> Is there a solution to this? >> Thanks in advance! >> >> Lars |
|
From: Molde N. O. <nil...@ed...> - 2009-11-26 09:16:30
|
Have You tried setting -Djava.awt.headless=true as parameter? -----Original Message----- From: Lars Schnoor [mailto:Lar...@if...] Sent: 26. november 2009 09:06 To: wra...@li... Subject: Re: [Wrapper-user] Starting Swing application from Linux daemon Hi again I guess since there haven't been any replies to this problem, that there is no solution? Lars Lars Schnoor wrote: > Hi > I would like to have my application which is started as a Linux daemon > to present a graphical user interface to the user. The user interface is > written in Java Swing. > When I try to start the user interface I get an > java.awt.HeadlessException: > No X11 DISPLAY variable was set, but this program performed an operation > which requires it. > Is there a solution to this? > Thanks in advance! > > Lars > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Wrapper-user mailing list > Wra...@li... > https://lists.sourceforge.net/lists/listinfo/wrapper-user > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Wrapper-user mailing list Wra...@li... https://lists.sourceforge.net/lists/listinfo/wrapper-user |
|
From: Leif M. <le...@ta...> - 2009-11-27 10:39:46
|
Molde, Thank you. The java.awt.headless parameter is very useful when you need to run Java in an environment where it WILL be headless. It makes it possible to do things like generate jpegs etc by telling Java not to look for the native libraries to do so. In this case however, Lars is wanting to show a GUI in a Windowing environment from a Java process running as a daemon. Thanks for the post. Cheers, Leif On Thu, Nov 26, 2009 at 5:41 PM, Molde Nils Ottar <nil...@ed...> wrote: > Have You tried setting -Djava.awt.headless=true as parameter? > > -----Original Message----- > From: Lars Schnoor [mailto:Lar...@if...] > Sent: 26. november 2009 09:06 > To: wra...@li... > Subject: Re: [Wrapper-user] Starting Swing application from Linux daemon > > Hi again > I guess since there haven't been any replies to this problem, that there > is no solution? > > Lars > > Lars Schnoor wrote: >> Hi >> I would like to have my application which is started as a Linux daemon >> to present a graphical user interface to the user. The user interface is >> written in Java Swing. >> When I try to start the user interface I get an >> java.awt.HeadlessException: >> No X11 DISPLAY variable was set, but this program performed an operation >> which requires it. >> Is there a solution to this? >> Thanks in advance! >> >> Lars >> |