没有 X 的 Java Web 启动
我需要使用 SSH 在不同的 Linux 服务器中启动我的应用程序。我想使用 java web start,这样我就可以打包我的应用程序一次,并通过动态下载应用程序在服务器上运行它。最大的问题是服务器没有启动 X,当我启动命令时
javaws-Xnosplash
应用程序立即返回,没有输出。
有没有办法让应用程序的 stdout/stderr 了解出了什么问题?
编辑:抱歉,描述不完整。该应用程序不使用 GUI,它应该作为命令行应用程序运行。我需要 JWS,因为我可以使用具有大量参数的不同启动文件来进行测试,并且我可以部署应用程序一次,然后在多个服务器上运行它。
现在,当我使用 java 命令运行它时,一切正常,使用 javaws 命令会安静地返回,我不知道出了什么问题。
ps 我在 /.java/* 目录下看不到任何日志
I need to start my application in different Linux servers using SSH. I thought to use java web start so I can pack my application once and run it on the servers by dynamically downloading the application. The big problem is that the server does not have X started and when I launch the command
javaws -Xnosplash
the application returns immediately with no output.
Is there a way to get the stdout/stderr of the application to understand what is going wrong?
Edit: Sorry the description is incomplete. The application does not use a GUI, it is supposed to run as a command line application. I need JWS because I can use different launch files with an high number of parameters for testing purposes, and I can deploy the application once, and run it on multiple servers.
Now when I run it using the java command everything works fine, with javaws the commands returns quietly and I do not know what is going wrong.
p.s. I cannot see any logs under /.java/* directory
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我们运行多个需要显示器才能正确运行的应用程序
在 Linux 上,我们使用 xvfb成功。
我不认为 AWT/Swing 类可以在没有显示/帧缓冲区的情况下初始化自己
we run several applications that needs a display to run correctly
On Linux, we're using xvfb with great success.
I don't think AWT/Swing classes can initialize themselves without display/framebuffer
我建议您使用 OpenJDK - 它与 JDK 共享大部分代码,但它使用自己的 Java web start 开源实现。如果它还不支持这一点,您可以将其修改为相当轻松地以基于文本的方式运行。
I would suggest you use OpenJDK - it shares most of the code with the JDK, but it uses its own open source implementation of Java web start. If it doesn't already support this, you can probably modify it to run in a text-based way fairly easily.
在 Linux 上,Java Web Start(默认情况下)将跟踪文件放在
http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/tracing_logging.html
On Linux, Java Web Start (by default) puts trace files in
http://download.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/tracing_logging.html