无法在任何浏览器中打开小程序

Unable to open applet in any of the browser

我正在尝试将小程序嵌入 html 页面并在浏览器中查看它,但我无法在任何浏览器中查看它。 (Firefox、Chrome、Edge、Internet Explorer 是我检查过的浏览器,而且我在上述所有浏览器中都启用了 java 小程序。)

下面是我的 applet.java 文件代码。

import java.applet.Applet;
 import java.awt.Graphics;

 public class MyApplet extends Applet {
     @Override
     public void paint(Graphics g) {
         g.drawString("Hello applet!", 50, 25);
     }
 }

下面是 html 文件的代码。

<html>
<head>
    <title>First Applet</title>
</head>
<body>
    <p>This is my first applet.</p>
        <embed code="MyApplet.class" 
            codebase="."
            type="application/x-java-applet;version=1.8">
            <noembed>
                No Java Support.
            </noembed>
        </embed>
</body></html>

.class file, .java file and .html files are all in the same folder.

现代浏览器不支持 java 小程序;根据官方 Java 网站上的以下 post:

https://www.java.com/en/download/faq/chrome.xml

The Java Plugin for web browsers relies on the cross-platform plugin architecture NPAPI, which had been supported by all major web browsers for over a decade. Google's Chrome version 45 and above have dropped support for NPAPI, and therefore Java Plugin do not work on these browsers anymore.

此外,对于边缘,表示相同...