How to run a Java applet in a web browser

I have a java SE project or you can say applet , but I want to run this applet in a web browser, how is this possible?

I need to copy a jar file, something like this, I found out, but what is a possible solution?

+7
source share
2 answers

This tutorial pretty much covers everything from writing your applet to implementing it on your web page. If you have already made your applet, as it seems, scroll down to โ€œCall Appletโ€. Here is the code from the tutorial for a quick fix:

 <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> 
+9
source

Most modern browsers no longer support Java.

In September 2015, Google decided to remove Java support in its Chrome web browser. The Java plugin is based on an old API called the Netscape Plugin API, which has always had security issues. Google felt it was time to let go of this old technology and make the Internet move to newer and safer technologies like HTML5. When you visit a website or web service using Java, you now see the message: โ€œChrome browser does not support NPAPI plug-ins and therefore will not run all Java content. Switch to another browser (Internet Explorer or Safari on Mac) to launch Java plugin. "

The Java plug-in for web browsers relies on the cross-platform NPAPI plug-in architecture, which has been supported by all major web browsers for over a decade. Google Chrome version 45 (released in September 2015) discontinued support for NPAPI, which affects plugins for Silverlight, Java, Facebook Video, and other similar NPAPI-based plugins. Java applications are now offered through web browsers either as a launch web application (which does not interact with the browser after launch), or as a Java applet (which can interact with the browser). This change does not affect Web Start applications; it only affects applets.

If you have problems accessing Java applications using Chrome, Oracle recommends using Internet Explorer or Safari.

Developers and system administrators looking for alternative ways to support Chrome users should check out this Web Start application launch blog.

0
source

Source: https://habr.com/ru/post/911919/


All Articles