how to run a java applet in web browser

Most modern browsers no longer support Java.

In September 2015, Google decided to remove the support for Java in their Chrome web browser. The Java plugin is based on an old API called Netscape Plugin API that has always had security issues. 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. 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."

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. 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. 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). This change does not affect Web Start applications, it only impacts applets.

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

Developers and System administrators looking for alternative ways to support users of Chrome should see this blog regarding Launching Web Start applications.


This tutorial pretty much covers everything from writing your applet to embedding it on your web page. If you already have your applet done, as it seems, scroll down to "Invoking an 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>