java 为什么小程序在 JDK 9 中被弃用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45535112/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 08:45:10  来源:igfitidea点击:

Why were applets deprecated in JDK 9?

javaappletdeprecated

提问by Maksim

I have recently read in an article posted by Oracle that they are going to mark the Appletclass as deprecated in JDK 9. I have little experience with applets; I have only written some to understand the basics.

我最近在 Oracle 发布的一篇文章中读到,他们将Applet在 JDK 9中将该类标记为已弃用。我对小程序的经验很少;我只写了一些来了解基础知识。

Why are they unpopular, and what is the main reason for their deprecation?

为什么它们不受欢迎,它们被弃用的主要原因是什么?

回答by Suresh Atta

Applets were very popular a couple of years ago, but now the browser world changed and security is becoming a major focus for all major browser vendors.

几年前小程序非常流行,但现在浏览器世界发生了变化,安全性正成为所有主要浏览器供应商的主要关注点。

The Java team gave its complete set or reasons, alternatives etc. in the document Migrating from Java Applets to plugin-free Java technologies. On page 4, there is the following Executive Overview:

Java 团队在从 Java Applets 迁移到无插件 Java 技术的文档中给出了完整的集合或原因、替代方案等。在第 4 页上,有以下执行概述

With modern browser vendors working to restrict or reduce the support of plugins like Flash, Silverlight and Java in their products, developers of applications that rely on the Java browser plugin need to consider alternative options. Java developers currently relying on browser plugins should consider migrating from Java Applets to the plugin-free Java Web Start technology.

Supporting Java in browsers is only possible for as long as browser vendors are committed to supporting standards based plugins. By late 2015, many browser vendors had either removed or announced timelines for the removal of standards based plugin support, while some are introducing proprietary browser-specific extension APIs. Consequently, Oracle is planning to deprecate the Java browser plugin in JDK 9.

The deprecated plugin technology will be completely removed from the Oracle Java Development Kit (JDK) and Java Runtime Environment (JRE) in a future Java release TBD. Java Web Start applications do notrely on a browser plugin and will not be affected by these changes.

随着现代浏览器供应商努力限制或减少其产品中对 Flash、Silverlight 和 Java 等插件的支持,依赖 Java 浏览器插件的应用程序开发人员需要考虑替代选项。目前依赖浏览器插件的 Java 开发人员应该考虑从 Java Applet 迁移到无插件的 Java Web Start 技术。

只要浏览器供应商致力于支持基于标准的插件,就可以在浏览器中支持 Java。到 2015 年底,许多浏览器供应商要么删除了要么宣布了删除基于标准的插件支持的时间表,而一些则引入了专有的浏览器特定扩展 API。因此,Oracle 计划在 JDK 9 中弃用 Java 浏览器插件。

在未来的 Java 版本 TBD 中,弃用的插件技术将从 Oracle Java Development Kit (JDK) 和 Java Runtime Environment (JRE) 中完全删除。Java Web Start 应用程序依赖于浏览器插件并且不会受到这些更改的影响。

回答by OLIVER.KOO

In short, this is because many main stream browsers had either removed or planned to remove standards based plugin support, therefore Oracle wants Java developers to migrate from Java applets to plugin-free Java Web-start technologies.

简而言之,这是因为许多主流浏览器已经或计划移除基于标准的插件支持,因此 Oracle 希望 Java 开发人员从 Java 小程序迁移到无插件的 Java Web-start 技术。

Oracle published a paper called "Migrating from Java Applets to plugin-free Java technologies "it explains in detail of why Applets are being deprecated and alternative ways developer should use.

Oracle 发表了一篇名为“从 Java Applets 迁移到无插件 Java 技术”的论文,它详细解释了 Applets 被弃用的原因以及开发人员应该使用的替代方式。

I see Suresh quoting the executive overview below so I won't quote again.

我看到 Suresh 在下面引用了执行概述,所以我不会再引用了。