如何启动java-web-start应用程序并等待其退出? [英] How to start a java-web-start application and wait until it exits?

查看:106
本文介绍了如何启动java-web-start应用程序并等待其退出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚发现javaws -wait不能执行Windows上应该执行的操作.它将在应用完成之前返回.

I just found out that javaws -wait doesn't do what is supposed to do on Windows. It will return before the aplication finishes.

此错误已存在5年以上,并且由于无法修复而已关闭 6281477 ,所以我们需要一种解决方法.

This bug is more than 5 years old and closed as won't fix 6281477, so we need a workaround.

我正在寻找一种干净的解决方案,该解决方案将:

I looking for a clean solution that will:

  • 无人值守运行(无用户干预):
    • 当前,如果无法访问JNLP文件,Java将显示一个错误窗口.
    • run unattended (no user intervention):
      • currently if JNLP file is not accessible, Java will display an error window.

      最好为此Java或Python提供跨平台解决方案,但即使是Windows批处理解决方案也可以接受.

      It would be preferable to have a cross platform solution for this Java or Python but it would be acceptable even a Windows batch solution.

      推荐答案

      我知道这个问题已经很老了,但是这是javaws -wait的替代方法:javaws将以com.sun.javaws.Main开始javaw进程,如下所示:主班.

      I know this question is pretty old, but here is an alternative to javaws -wait: javaws will start a javaw process with com.sun.javaws.Main as main class.

      jcmd可以救援:

      while jcmd com.sun.javaws.Main PerfCounter.print > /dev/null 2> /dev/null  ; do
        echo "still running !"
        sleep 2
      done
      

      其中一个缺点是确定实际的Java cmd:如果运行了多个webstart应用程序,则仅当所有应用程序都关闭时,该命令才会退出.

      One down side of this is to determine the actual java cmd: if multiple webstart application are ran, then the command will exit only if all application are down.

      这篇关于如何启动java-web-start应用程序并等待其退出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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