How to get java plugin

Installing Chrome Java Plugin

I’ve been trying to install the Java plugin for Chrome for a couple hours now, and I figured it was time to ask people with more experience. I can’t seem to get it working. My current Java version is the 64-bit OpenJDK 1.6.0_24. I tried installing the IcedTea plugin to no avail. I have Ubuntu 12.04 64-bit installed at the moment. When I tried testing if java was enabled in Chrome, any website with a Java applet would not load (when I disabled the plugin, they loaded, but not the applet). I followed the instructions from here: http://technonstop.com/install-java-plugin-ubuntu-linux which said to create this script and run it:

JAVA_HOME=/usr/lib/jvm/jdk1.7.0 MOZILLA_HOME=~/.mozilla mkdir $MOZILLA_HOME/plugins ln -s $JAVA_HOME/jre/lib/i386/libnpjp2.so $MOZILLA_HOME/plugins 

Note: You may need to change the value of JAVA_HOME so that it correctly points to your installation of the JDK. 64-bit users will need to change the final line to:

ln -s $JAVA_HOME/jre/lib/amd64/libnpjp2.so $MOZILLA_HOME/plugins 

I have had the same problem. This problem frequently occurs with chromium in 64-bit. The best way to get rid of it is to use firefox instead of it.

No, absolutely not a duplicate. This one is about how to get the Java plugin for Chrome working, not about how to install Java.

When will you people understand that this is because Google Chrome has dropped support for NPAPI. This means that neither IcedTea or Oracle’s Java plugin will work with Google Chrome and there’s nothing you can do about it.

Читайте также:  Php unique user id

7 Answers 7

Alternate install Java for Chrome, can also install icedtea:

 sudo apt-get install icedtea-7-plugin 

Then link icedtea in to chromium plugin folder thusly

cd /usr/lib/chromium-browser/plugins 
sudo ln -s /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so 

I don’t have no /usr/lib/chromium-browser/plugins directory. nor can I seem to find the chrome plugins directory with locate chrome | grep plugins

@cerr, I did this and it worked: sudo mkdir -p /usr/lib/chromium-browser/plugins (plugin successfully installed)

I symlinked IcedTeaPlugin.so at both /usr/lib/chromium-browser/plugins and /opt/google/chrome/plugins/ but Google Chrome still says Java is not working . This is Xubuntu 14.04.

Java plug-in is not working anymore on Chrome (versions 45+). From here:

NPAPI support by Chrome

The Java plug-in for web browsers relies on the cross platform plugin architecture NPAPI, which has long been, and currently is, supported by all major web browsers. Google announced in September 2013 plans to remove NPAPI support from Chrome by «the end of 2014», thus effectively dropping support for Silverlight, Java, Facebook Video and other similar NPAPI based plugins. Recently, Google has revised their plans and now state that they plan to completely remove NPAPI by late 2015. As it is unclear if these dates will be further extended or not, we strongly recommend Java users consider alternatives to Chrome as soon as possible. Instead, we recommend Firefox, Internet Explorer and Safari as longer-term options.

Many answers are now dated. They did not work for my 14.04 Ubuntu install. For my instance of chrome is installed in /opt/google/chrome . So the plugin folder would have to be created in there.

  1. Create a directory called plugins if you do not have it. Type: mkdir -p /opt/google/chrome/plugins
  2. Go to Google chrome plugins directory before you make the symbolic link. Type: cd /opt/google/chrome/plugins
  3. Create a symbolic link. Type: ln -s /usr/local/java/jre1.7.0/lib/amd64/libnpjp2.so
  4. Restart your browser and test Java

Update for Chrome 34+ users

Please see java plugin in Chromium. Basiclly IcedTea plugin no longer works with Chome ever since Google disabled the NPAPI interface by default.

Ultimately my solution will be to switch back to firefox.

Don’t count on Firefox to continue working either. There are indications that they’re considering removing the NSAPI interface as well, and for much the same reasons. Security.

I have recently hit by the same bug. If you look in your ~/.xsession-errors file, you possibly see:

/build/buildd/icedtea-web-1.2/build/../plugin/icedteanp/IcedTeaNPPlugin.cc:2072: thread 0x7f08d1365470: Error: Invalid plugin function table. 

The bug report is Plugin fails to load in Chrome. A proposed update was released for the icedtea-6-plugin package and confirmed to work. This should land in a few days for all users.

Meanwhile, you can use a different browser as others suggested, Firefox works here.

The best solution I found, (none of these suggestions worked for me), is as followings: First install Icedtead pluging by:

Then in your chrome browser go to:

  • 2) chrome-> Settings-> Show Advanced Settings-> Privacy then click on Content Settings -> Plug-ins then click on Disable Individual Plug-in
  • 3) Disable both «IceTea-Web Plugin» and «Java(TM)«
  • 4) Restart the browser.
  • 5) chrome-> Settings-> Show Advanced Settings-> Privacy then click on Content Settings -> Plug-ins then click on Disable Individual Plug-in
  • 6) Enable only «IceTea-Web Plugin«
  • 7) Enjoy !

I tried this (installed openjdk-7 and icedtea-7) but there is neither icedtea nor java plugins showing in chrome. How do I force Chrome to see them? I also installed Oracle Java7 and softlinked its libnpjp2.so into /opt/google/chrome/plugins but it makes no difference: it doesn’t show up or work.

I’ve been having the same problem. After digging around for a while, I found that Chrome is a 32 bit application that does not have support for 64 bit Java. (A related issue is explained by Oracle here.)

This means you would have to install a 32 bit version of Java (basically Java 6) on your system. I personally have given up on the venture, but this older question might be of some help.

In my case, Chromium was not starting the app, no messages, just a grey box appearing where the app would be, so it was doing something, but not enough. Which sounds similar to OP. Non-browser java apps had previously been running ok on my system.

An article somewhere suggested using which javac to determine installed status. This generated no terminal output. So I tried just calling javac, and got the list of installer packages for java. So I think I had some sort of limited install, no idea what or why.

Executed sudo apt-get install openjdk-7-jdk and then re-enabled the icedtea Chromium plugin (via Settings | Advanced Settings | Privacy | Content settings | Disable individual plugins) which I had disabled earlier while trying other things. There were no other Java plugins in the list.

Ta-dah! Java apps now working in Chrome. I can’t remember how or whence I installed Java previously, but it was likely a ‘least resistance’ approach, so I suspect some others may also have the same system state.

Источник

How to download and install Java plugin in a browser

Java applets (Plugins) were introduced in the first version of Java. From early 2010 major browsers started avoiding Java applets because of security constraints and difficulty with the underlying platforms. Java Applets are deprecated in Java 9 and are completely removed from Java 11.

Applets are usually written in Java. However, they can even be written with any other language run on JVM like Jython, Scala, Pascal, JRuby and so on.

Some advantages of Java Applets are as below,

  • They can run much faster compared Javascript
  • Since they run as a separate process on JVM, they get access to all the system resources including hardware
  • Till the canvas support came into existence applets were the favorite to render 3D graphics
  • Cross-platform, once created can be run on any platform

It is important to note that, in modern browsers, Java support has to be enabled manually as Java isn’t enabled by default.

2. Enable Java support in browsers

In this section, we will see how Java can be enabled in various browsers on the Windows platform.

2.1. Internet Explorer

  1. Click on Tools menu and click on Internet Options
  2. Go to Security tab and click on Custom Levels
  3. In the new popup scroll to Scripting section and enable/disable Java by going to the section Scripting of Java Applets

2.2. Google Chrome

  1. Click on the wrench icon on the far right of the address bar
  2. On the menu click on Settings
  3. Click on Advanced settings at the end of the Settings menu
  4. Click on Content Settings
  5. Scroll down to Plug-ins and look for Java and click on Disable link to turn on/off the Java plugins

2.3. Mozilla Firefox

  • Click on the little hamburger icon (Tools menu) on the far right next to address bar and choose Add-Ons menu
  • Click on Plugins from the left side menu and scroll down to the bottom
  • Click on Java Applet Plugins to enable/disable Java plugins

2.4. Safari

  • Go to Preferences
  • Click on Security
  • Scroll down to Enable Java. Enable or Disable by clicking on the checkbox

3. Java Plugin Example

In this section, I will show how to write a sample Java Plugin. I am using the IntelliJ Idea editor and in the end, I have attached the complete source code.

3.1. Java plugin lifecycle

  • Init – init() method is to group initialization logic. This method runs first when the applet is run.
  • Start – the start() method runs after the init method and it contains the actual code to run. This method runs each time when the plugin is restored or tabs are switched.
  • Paint – paint() method is used to redraw the applet. This method is invoked after the start method and whenever the browser is refreshed and resized.
  • Stop – this method is automatically called whenever the user moves off the page where the plugin sits. Stop method is called whenver the plugin window is minimized and even when the browser tabs are switched.
  • Destroy – this method is automatically called whenever the browser is shut down normally. This method removes the plugin object from the memory.

3.2. Example program

In this section, I am going to show a basic plugin program that shows the applet lifecycle methods.

package com.jcg.plugin; import java.applet.Applet; import java.awt.*; public class JavaPluginDemo extends Applet < //init method is called only once, when the plugin class is initially loaded public void init() < System.out.println("Plugin initialized"); >//executed immediately after init method. It gets executed each time when the plugin //is reloaded, resized and refreshed public void start() < System.out.println("Plugin execution started"); >//executed whenever the plugin is minimized and user moved to another tab public void stop() < System.out.println("Plugin execution stopped"); >//redraws the output on the plugin. executed immediately after the start method. //executed whenever applet is resized and refreshed public void paint(Graphics g) < System.out.println("Painting the plugin"); g.drawString("Painting the applet. ", 10, 40); >//executed only once like init method. executed when the applet is closed public void destroy() < System.out.println("Plugin is bing removed"); >>

Right-click on the program and click run. This launches the applet viewer. Output in the applet viewer is as in the below image,

Java plugin - output

Output from the plugin lifecycle methods is as follows,

Java plugin - lifecycle methods output

In the above output, you can notice that start, paint and stop methods are called multiple times. Whereas, init and destroy are called only once.

3.3. Serving Java Plugins

Plugins can be locally viewed in Applet Viewer. When it has to be served to a remote computer, it has to be served via HTML. Below is the sample HTML snippet to serve Java Plugin,

tag is used to serve the applets.

4. Download Source Code

Download
You can download the full source code of this example here: How to download and install Java plugin in a browser

Источник

Оцените статью