JNLP/Java Web Start 可以启动命令行应用程序吗

发布于 2024-12-22 04:30:58 字数 814 浏览 3 评论 0原文

我有一个简单的 JNLP 文件,用于启动 Hello World 命令行应用程序。当我从 Tomcat (7) 下载 JNLP 文件时,Java Web Start 启动然后消失,没有启动命令提示符并打印应用程序的输出。这是因为它不能用于启动命令提示符窗口吗?我打开日志记录并没有看到任何异常,但在跟踪日志的末尾我看到了输出。

使用 Windows 7,在 Chrome 和 FireFox

JNLP中进行测试

<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for SimpleExample Application -->
<jnlp 
  codebase="http://localhost:8080/foo"
  href="foo.jnlp">    
<information>
       <title>Foo</title>
       <vendor>Paul C</vendor>
       <description>Command Line App</description>
       <offline-allowed/>
     </information>
     <resources>
       <j2se version="1.6"/>
       <jar href="foo.jar"/>
     </resources>
     <application-desc/>
</jnlp>

I have a simple JNLP file that launches a Hello World command line application. When I download the JNLP file from Tomcat (7), Java Web Start starts up and then goes away without launching the command prompt and printing the output from the application. Is this because it cannot be used to launch the command prompt window ? I turned on logging and saw no exceptions, but at the end of the trace log I saw the output.

Using Windows 7, tested in Chrome and FireFox

JNLP

<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for SimpleExample Application -->
<jnlp 
  codebase="http://localhost:8080/foo"
  href="foo.jnlp">    
<information>
       <title>Foo</title>
       <vendor>Paul C</vendor>
       <description>Command Line App</description>
       <offline-allowed/>
     </information>
     <resources>
       <j2se version="1.6"/>
       <jar href="foo.jar"/>
     </resources>
     <application-desc/>
</jnlp>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

擦肩而过的背影 2024-12-29 04:30:58

这是因为它无法用于启动命令提示符窗口吗?

正是这个原因。如果 Java 控制台配置为在小程序或 JWS 应用程序启动时显示。您将能够看到基于 CLI 的应用程序的 System.out.println(),但进一步(基于命令行)输入并不实用。

Is this because it cannot be used to launch the command prompt window?

That is exactly the reason. If the Java Console is configured to show on launch of an applet or JWS app. you will be able to see the System.out.println() of a CLI based app., but further (command line based) input is not practical.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文