我可以从 Java 应用程序中删除下载的 JNLP 文件 (Java web start/JWS) 吗?
Google Chrome 不会自动启动 JNLP 文件,因此我建议我们的用户 此解决方案。它可以工作,但下载的 JNLP 文件仍保留在下载文件夹中。手动删除很麻烦。
我想向我们的 Java 应用程序添加一个功能:
- Google Chrome 下载 JNLP 文件并打开它。
- JNLP 文件启动我们的 Java 应用程序。
- Java应用程序删除了JNLP文件(<=我想要这个功能!)
我可以获取启动Java应用程序的下载的JNLP文件的文件路径吗? 当然,我们的 Java 应用程序 jar 已签名并且可以访问本地资源。
Google Chrome does not launch JNLP file automatically, so I recommend for our users this solution. It works but the downloaded JNLP file remains in download folder. Deleting them manually is troublesome.
I want to add a function to our Java application:
- Google Chrome downloads a JNLP file and open it.
- The JNLP file starts our Java application.
- The Java application deletes the JNLP file (<= I want this function!)
Can I get the file path of the downloaded JNLP file which started the Java application?
Of cause, our Java application jar is signed and can access local resources.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Java WebStart 论文中没有任何内容描述这种机制,因此您处于“特定于供应商”的领域,并且我认为没有 API 让您的应用程序知道 JNLP 文件在哪里。
但是,您可以提供 javaws 的替代品,它使用 -wait 调用原始 javaws,然后删除 JNLP 文件。这必须由用户安装。
There is nothing in the Java WebStart paper that describes such a mechanism, hence you are in "vendor-specific" territory, and I do not think that there is an API letting your application know where the JNLP file is.
You can, however, provide a replacement for javaws which invoke the original javaws with -wait and delete the JNLP file afterwards. This must be installed by the user.