在无头服务器中运行Java AWT / Swing GUI应用程序 [英] Run Java AWT/Swing GUI app in headless server

查看:371
本文介绍了在无头服务器中运行Java AWT / Swing GUI应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网关应用程序,它提供了一个登录对话框,然后是一个GUI窗口。我将在没有显示器的共存服务器上运行此应用程序。我只需要在登录时与对话框进行交互,并且可能偶尔会检查主GUI。服务器是Debian 5.0。

I have a gateway application that comes up with a login dialog and then a GUI window. I will be running this app on a co-located server without a display. I need to interact with the dialog only when logging in and perhaps to check out the main GUI occasionally. The server is Debian 5.0.

到目前为止我唯一的想法是:

The only ideas I have so far are:


  1. 将X会话隧道传送到我的桌面进行登录,但我不确定如果X会话断开连接会发生什么(即我重新启动桌面等等)。

  1. Tunnel an X session to my desktop for logging in but I'm not sure what will happen if the X session disconnected (ie, I reboot my desktop, etc..)

尝试从包装Java应用程序实例化/启动应用程序,该应用程序可以填写登录对话框或直接登录但是我很可能失去以这种方式和其他方面查看主GUI的能力可能会发生这样的影响。

Try to instantiate/launch the app from a wrapper Java application that can hopefully fill out the login dialog or login directly however I would most likely lose the ability to see the main GUI this way and other side effects might occur.

这个特定的应用程序是用Swing编写的并且没有提供命令行太糟糕了只有模式或守护进程模式。

It's too bad this particular app was written in Swing and doesn't provide a command-line only mode or daemon mode.

推荐答案

您可以在运行应用程序的机器上运行VNC服务器。然后你可以随时连接到虚拟X服务器与用户界面进行交互。

You can run a VNC server on the machine where the application runs. Then you can connect to the virtual X-server at any time to interact with the user interface.

我附近没有Debian系统,但是在Ubuntu上有包vnc4server,提供您需要的功能。

I don't have a Debian system nearby, but on Ubuntu there is a package vnc4server that provides the features you need.

这篇关于在无头服务器中运行Java AWT / Swing GUI应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆