简体   繁体   English

java小程序有什么替代的小程序?

[英]What is the alternative to java applet applets?

I am working on a web application, in which we have one client applet application that will check the certificate is installed on the client's machine or not.我正在开发一个 web 应用程序,其中我们有一个客户端小程序应用程序,它将检查客户端机器上是否安装了证书。

But you all know Mozilla will stop to support applets very soon.但是你们都知道 Mozilla 很快就会停止支持小程序。

Can anyone suggest what is an alternate option for doing the same?谁能建议做同样的事情的替代选择是什么?

A good alternative to applets is Java Web Start . Applet 的一个很好的替代品是Java Web Start If the client has java installed and can run applets then this will work too.如果客户端安装了 java 并且可以运行小程序,那么这也可以工作。

Java Webstart Java 网络启动

The other answer is out of date.另一个答案已过时。 The Java WebStart (JWS) implementation in the OpenJDK codebase was deprecated in Java 9 and removed entirely in Java 11. This affects all Java distros that are based on OpenJDK... including the Oracle Java distros. OpenJDK 代码库中的 Java WebStart (JWS) 实现已在 Java 9 中弃用,并在 Java 11 中完全删除。这会影响所有基于 OpenJDK 的 Java 发行版...包括 88404789628553288 发行版

However, all is not lost.然而,一切并没有丢失。

  1. You can still use JWS in releases prior to Java 11. Java 8 is still supported by Oracle, and by other vendors.您仍然可以在 Java 11 之前的版本中使用 JWS。Java 8 仍然受 Oracle 和其他供应商支持。
  2. A company (Karakun AG) treated the removal of JWS in Java 11 as a business opportunity, and created an open source replacement for JWS in the form of OpenWebStart .一家公司 (Karakun AG) 将 Java 11 中 JWS 的移除视为商机,并以OpenWebStart的形式创建了 JWS 的开源替代品。 There is a feature table that documents the features of the JWS specification that are supported.有一个功能表记录了受支持的 JWS 规范的功能。 OpenWebStart is available as a community edition (no support) or with different levels of paid support. OpenWebStart 可作为社区版(无支持)或提供不同级别的付费支持。

But note:但请注意:

  1. OpenWebStart does not support applets, and according to the OpenWebStart FAQ, they have no intention of supporting them. OpenWebStart 不支持小程序,根据 OpenWebStart FAQ,他们无意支持它们。

  2. Java Webstart didn't support applets either. Java Webstart 也不支持小程序。 It was always an alternative deployment mechanism rather than a way to run code in the user's web browser.它始终是一种替代部署机制,而不是一种在用户的 web 浏览器中运行代码的方式。

The Real Answer - Rewrite your code真正的答案——重写你的代码

If you are still looking for a direct replacement for applets, forget it.如果您仍在寻找 applet 的直接替代品,那就算了。 There isn't one.没有一个。 Applets are dead technology.小程序是死技术。 They were terminally ill for decades, and the death knell came in 2016 when Oracle announced that they would be deprecated and withdrawn.几十年来,它们都身患绝症,丧钟在 2016 年敲响,当时 Oracle宣布它们将被弃用并撤回。

  • If you want a way to deploy and launch a conventional Java desktop application (eg JavaFX or Swing + AWT) then OpenWebStart is a good option.如果您想要一种部署和启动常规 Java 桌面应用程序(例如 JavaFX 或 Swing + AWT)的方法,那么 OpenWebStart 是一个不错的选择。 However, the user does need to download and install OpenWebStart to bootstrap the process.但是,用户确实需要下载并安装 OpenWebStart 来引导该过程。

  • Other alternatives supported by Oracle / OpenJDK are to use jlink or jpackage to produce (respectively) a custom JRE or a native executable for your application. Oracle / OpenJDK 支持的其他替代方案是使用jlinkjpackage为您的应用程序(分别)生成自定义 JRE 或本机可执行文件。 These need to be deployed and updated by conventional means.这些需要通过常规方式部署和更新。

  • If you have an application that needs to run in your users' web browser, you should look at recoding it in Javascript. Java is no longer a sensible option for this kind of application.如果您的应用程序需要在用户的 web 浏览器中运行,您应该考虑在 Javascript 中重新编码。Java 不再是此类应用程序的明智选择。

All of the above require you to rewrite your old applet code.以上所有这些都需要您重写您的旧小程序代码。 TINA . 蒂娜

Java Vaadin , a free web framework. Java Vaadin ,一个免费的 web 框架。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM