简体   繁体   English

如何在Web浏览器中运行Java applet

[英]how to run a java applet in web browser

I have a java SE project or you can say applet , but i want to run this applet in web browser how is it possible? 我有一个java SE项目或者你可以说applet ,但我想在网络浏览器中运行这个applet怎么可能?

I need to copy jar file something like this i came to know but what is the possible solution? 我需要复制这样的jar文件我才知道但是可能的解决方案是什么?

This tutorial pretty much covers everything from writing your applet to embedding it on your web page. 本教程几乎涵盖了从编写applet到将其嵌入网页的所有内容。 If you already have your applet done, as it seems, scroll down to "Invoking an applet". 如果您已完成applet,请向下滚动到“调用applet”。 Here's the code from the tutorial for a quick solution: 以下是教程中用于快速解决方案的代码:

<html>
<title>The Hello, World Applet</title>
<hr>
<applet code="HelloWorldApplet.class" width="320" height="120">
If your browser was Java-enabled, a "Hello, World"
message would appear here.
</applet>
<hr>
</html>

Most modern browsers no longer support Java. 大多数现代浏览器不再支持Java。

In September 2015, Google decided to remove the support for Java in their Chrome web browser. 2015年9月,Google决定在其Chrome网络浏览器中删除对Java的支持。 The Java plugin is based on an old API called Netscape Plugin API that has always had security issues. Java插件基于一个名为Netscape Plugin API的旧API,它始终存在安全问题。 Google felt that it was time for them to let go of this old technology and make the Web move on to newer and safer technologies like HTML5. 谷歌认为现在是时候让他们放弃这项旧技术,让网络转向更新,更安全的技术,如HTML5。 When you visit a website or web service that is using Java, you now see a message that says: "The Chrome browser does not support NPAPI plug-ins and therefore will not run all Java content. Switch to a different browser (Internet Explorer or Safari on Mac) to run the Java plug-in." 当您访问使用Java的网站或Web服务时,您现在会看到一条消息:“Chrome浏览器不支持NPAPI插件,因此不会运行所有Java内容。切换到其他浏览器(Internet Explorer或Mac上的Safari)运行Java插件。“

The Java plug-in for web browsers relies on the cross platform plugin architecture NPAPI, which has been supported by all major web browsers for over a decade. 用于Web浏览器的Java插件依赖于跨平台插件架构NPAPI,该架构已经被所有主要Web浏览器支持了十多年。 Google's Chrome version 45 (released in September 2015) dropped support for NPAPI, impacting plugins for Silverlight, Java, Facebook Video and other similar NPAPI based plugins. 谷歌的Chrome版本45(2015年9月发布)放弃了对NPAPI的支持,影响了Silverlight,Java,Facebook Video和其他类似基于NPAPI的插件的插件。 Java applications are now offered though web browsers as either a web start application (which do not interact with the browser once they are launched) or as a Java applet (which might interact with the browser). Java应用程序现在通过Web浏览器提供为Web启动应用程序(启动后不与浏览器交互)或Java applet(可能与浏览器交互)。 This change does not affect Web Start applications, it only impacts applets. 此更改不会影响Web Start应用程序,它只会影响applet。

If you have problems accessing Java applications using Chrome, Oracle recommends using Internet Explorer or Safari instead. 如果您在使用Chrome访问Java应用程序时遇到问题,Oracle建议您使用Internet Explorer或Safari。

Developers and System administrators looking for alternative ways to support users of Chrome should see this blog regarding Launching Web Start applications . 寻找替代方法来支持Chrome用户的开发人员和系统管理员应该看到有关启动Web Start应用程序的博客。

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

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