Java Web Start 的替代品?

发布于 2024-11-04 17:53:39 字数 1539 浏览 0 评论 0原文

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

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

发布评论

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

评论(5

难如初 2024-11-11 17:53:39

我感受到你的痛苦,我对 JWS 遇到的最大问题是可见性,即它在做什么以及为什么这样做。我们的大多数问题都与内部代理有关(Java 似乎真的不喜欢验证代理),并且目前问题似乎已得到解决。尽管如此,我确实考虑过简单地写一个替代品。这并不像听起来那么疯狂,JWS 做了很多我并不真正关心的事情,即与 Web 浏览器集成并检查 JVM 版本。考虑以下场景:

  1. 您启动一个 Java 应用程序(启动应用程序)。该应用程序采用一个参数,即 JNLP 文件的 URL。
  2. 启动应用程序对 URL 进行哈希处理,并将其用作本地文件夹(存储库)的基础,在其中存储应用程序的任何下载的 jar。如果存储库不存在,它将创建它。
  3. 启动应用程序尝试下载 URL 指向的 JNLP。如果它无法下载它,它只会启动存储库中的任何内容(可能会警告用户)
  4. 如果它可以下载 JNLP,解析它并列出任何需要下载的 jar。如果您已经有了这些 jar,请使用 Apache HttpClient 之类的工具来确定服务器是否有较新的版本,并根据需要进行下载。重要的一点是任何下载都应存储在临时文件夹中。一旦全部下载成功,您就可以将它们应用到本地存储库。理想情况下,您将备份已有的内容,以便允许某种回滚过程。

与常规 JNLP 相比,这应该提供一些非常显着的优势:

  1. 可见性,您可以准确记录正在发生的情况
  2. 更好的故障模式:如果下载中断,只需启动已经存在的版本(显然,如果中断发生在第一次下载),如果您想告诉用户,那就这样做。
  3. 通过作为本地应用程序运行,您应该避免遇到 jar 签名问题,老实说,我不了解有关签名 jar 的 Java Web Start 安全模型,但似乎如果涉及不同的类加载器,JWS 会抱怨它(我想)

可悲的是,我不能因为上述的工作版本而解雇你,我确实启动了一个原型,但暂停了它。在这种情况下,我可能需要在将来返回它,我很乐意分享完成的版本。

干杯,
菲尔

I feel your pain, the biggest issue I've had with JWS is visibility, that is, what is it doing and why is it doing it. Most of our issues were related to internal proxies (Java seems to really not like authenticating proxies) and the wrinkles seem to be ironed out for the moment. Nevertheless, I did consider simply writing a replacement. This is not as crazy as it sounds, JWS does an awful lot of stuff that I don't really care about, namely, integrating with the web browser and checking JVM versions. Consider the following scenario:

  1. You launch a Java application (the launch app). This application takes a single parameter which is a URL of a JNLP file.
  2. The launch app hashes the URL and uses this as the basis for a local folder (repository) in which to store any downloaded jars for the app. If the repository doesn't exist, it will create it.
  3. The launch app attempts to download the JNLP pointed to by the URL. If it can't download it, it will just launch whatever is in the repository (maybe warning the user)
  4. If it can download the JNLP, parse it and list any jars that need downloading. If you already have the jars, use something like Apache HttpClient in order to determine whether the server has a newer version and download if required. The important point is that any downloads should be stored in a temporary folder. Once ALL of the downloads have succeeded, you can apply these to the local repository. Ideally, you will back up what is already there in order to allow some sort of rollback procedure.

This should provide some very significant advantages over regular JNLP:

  1. Visibility, you can log exactly what is happening
  2. Much better failure modes: if the download gets interrupted just launch the version that's already there (obviously, this won't work if the interrption occurs on the first download), if you feel like telling the user about it then do so.
  3. By running as a local app you should avoid running into issues with signing of jars, I honestly don't understand the Java Web Start security model with respect to signed jars but it seems that if different classloaders are involved, JWS will complain about it (I think)

Sadly, I'm not in a position to fire you over a working version of the above, I did start a prototype but suspended it. I may have to return to it in future in which case, I'll be happy to share the finished version.

Cheers,
Phil

游魂 2024-11-11 17:53:39

目前,我们使用 GetDown 来处理 Swing 应用程序的分发。我们使用 Tomcat 分发更新,并使用 GetDown 下载这些更新。它非常灵活且功能强大,比 java WebStart 好得多,并且因为它为更改生成校验和,所以可以节省带宽并下载刚刚更改的文件。

一个很好的教程: http://www.hascode.com/2012/05/creating-updatable-java-applications-using-getdown-and-the-getdown-maven-plugin/

Currently we are using GetDown to handle distribution of our swing applications. We use Tomcat to distribute updates and GetDown to download those updates. It's really flexible and powerful, and much better than java WebStart and because it produces check sum for changes it saves bandwith and downloads just changed files.

A good tutorial : http://www.hascode.com/2012/05/creating-updatable-java-applications-using-getdown-and-the-getdown-maven-plugin/

短叹 2024-11-11 17:53:39

您可以使用安装程序:例如 Install4j

您可以在此处找到安装程序列表:安装 Java EE 应用程序有哪些好的 InstallAnywhere 替代品?

You could use an installer: for example Install4j.

You can find a list of installers here: What are good InstallAnywhere replacements for installing a Java EE application?

离笑几人歌 2024-11-11 17:53:39

随着 Java Web Start 被 Oracle 弃用,我们正在考虑使用 Microsoft 的 .NET Click Once 下载并启动我们的 Java 应用程序。

我们将有一个Click Once .application 文件运行一个小的MS 程序来检测Java,下载我们最新的jar 文件,然后使用检测到的Java 版本和Jar 文件启动我们的Java 程序。

当然,这只是针对 Windows 计算机的解决方案,但我们是专门使用 Windows 的客户,因此这适用于该环境。

MS 的 Click Once:https://learn.microsoft。 com/en-us/visualstudio/deployment/clickonce-security-and-deployment

With Java Web Start being deprecated by Oracle, we are considering using Microsoft's .NET Click Once to download and launch our Java application.

We will have a Click Once .application file run a little MS program that detects Java, downloads our latest jar files and then launches our Java program using the detected version of Java and the Jar files.

Of course, this is only a solution for Windows machines, but we are customers are exclusively on Windows, so this works in that environment.

MS's Click Once: https://learn.microsoft.com/en-us/visualstudio/deployment/clickonce-security-and-deployment

仅一夜美梦 2024-11-11 17:53:39

您也可以尝试零安装。它是跨平台的(Linux、Win、Mac),提供 jrd 下载和自动更新,并且具有良好的系统集成。

在我看来,它的缺点是不容易处理。

http://0install.net/

You could also give Zero Install a try. It's cross platform (Linux, Win, Mac), offers jrd download and auto update and has a nice system integration.

Drawback in my eyes that its not easy to handle..

http://0install.net/

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