Java plug-in

from Wikipedia, the free encyclopedia

The Java plug-in is a software component that can be used to run Java applets in a web browser .

It represents the connection between different browsers ( Mozilla Firefox , Mozilla , Internet Explorer , Apple Safari , Netscape Navigator , Opera ) and the Java Development Kit (JDK) installed on the computer. This makes it possible to use <object>or <applet>tags in a HTML page to start Java applets. The Google Chrome browser required for running Java applets plug-in architecture supports version 45 (September 2015) NPAPI no more.

construction

The Java plug-in basically consists of a native code part and a code part written in Java. The native code part establishes the connection to the respective browser and, in the case of Internet Explorer, is z. B. an ActiveX Control (jpishare.dll, jpicom32.dll, RegUtils.dll, jpiexp32.dll, npjpi142_08.dll). The Java code part is located in a Java archive called “plugin.jar”.

initialization

The start or initialization of the Java applet takes place using the plug-in in a three-stage process. This process is <object>explained here using the example of Internet Explorer and a page with a tag.

  • The browser parses the HTML page and starts the <object>ActiveX control specified for the tag via CLSID. This initializes the C ++ part of the Java plug-in. This loads the Java Virtual Machine of the corresponding platform as a library (JVM.DLL or libjvm.so) into the memory and starts it via the JNI Invocation Interface.
  • The native part transfers control to the Java part ( AppletViewer.initEnvironment()) and this initializes its state. Here z. B. browser-dependent classes are loaded, various locations searched for settings files, the JarCache initialized and the Java console started. All applets run in their own thread group. The parameters of the tag (archive, codebase etc.) are transferred to the native code using Windows PropertyBags. The Java code then receives this as a Java on each platform HashMap.
  • The class IExplorerPluginObjectin the now activated JVM waits for two callbacks ( containerReady(), frameReady()) which signal this component that Internet Explorer is ready. Now the applet's archives are loaded in parallel by several download threads . Finally, the applet's life cycle begins by calling the init()and start()methods.

Web links

Individual evidence

  1. Java and Google Chrome browser. In: Oracle Corporation . November 11, 2016. Retrieved October 29, 2017 .