20

I want to add java plugin for FireFox (v10.0.12) on Linux(Centos 5.6 64bit).

I have JDK 1.7.0_12 installed, and add a symbolic link to plugin folder under /usr/lib/mozilla to the file libnpjp2.so under (JRE)/lib/amd64/ Followd this http://www.oracle.com/technetwork/java/javase/manual-plugin-install-linux-136395.html

But I still couldn't find java plugin on my Firefox Add-ons Manager.

What might be the problem ?

Frank
  • 1,315
  • 7
  • 24
  • 43
  • 2
    If he is asking here, almost certain he is a developer. Perhaps he needs it for development ? I am really fed up of such narrow-minded reactions on here... –  Sep 17 '16 at 14:13

2 Answers2

32

Do you want the JDK or the JRE? Anyways, I had this problem too, a few weeks ago. I followed the instructions here and it worked:

http://www.backtrack-linux.org/wiki/index.php/Java_Install

NOTE: Before installing Java make sure you kill Firefox.

root@bt:~# killall -9 /opt/firefox/firefox-bin

You can download java from the official website. (Download tar.gz version)

We first create the directory and place java there:

root@bt:~# mkdir /opt/java

root@bt:~# mv -f jre1.7.0_05/ /opt/java/

Final changes.

root@bt:~# update-alternatives --install /usr/bin/java java /opt/java/jre1.7.0_05/bin/java 1

root@bt:~# update-alternatives --set java /opt/java/jre1.7.0_05/bin/java

root@bt:~# export JAVA_HOME="/opt/java/jre1.7.0_05"

Adding the plugin to Firefox.

For Java 7 (32 bit)

root@bt:~# ln -sf $JAVA_HOME/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins/

For Java 8 (64 bit)

root@bt:~# ln -sf $JAVA_HOME/jre/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins/

Testing the plugin.

root@bt:~# firefox http://java.com/en/download/testjava.jsp

Community
  • 1
  • 1
Yankee
  • 1,011
  • 1
  • 9
  • 18
  • 1
    Thank you for your answer, I just figured out my problem is that my link is created under /usr/lib/Mozilla/plugin, which is incorrect, because I using 64 bit centos, the folder should be /usr/lib64/mozilla/plugin – Frank Jan 23 '13 at 23:44
  • 1
    Your answer was far better than whatever Oracle provided for Linux installation. Should the `JAVA_HOME` variable point to `/opt/java/jre1.7.0_05` instead of the actual executable? – austin Dec 16 '13 at 23:07
  • @austin it looks like JAVA_HOME's purpose is to show 3rd party tools like Gradle or Maven where the Java build tools are located. See http://stackoverflow.com/a/2025295/1999239 – Yankee Sep 18 '16 at 00:14
  • It seems like plugins are not supported (with exception of Flash) in FF since version 52. – Ondrej Bozek Apr 21 '17 at 08:17
9

you should add plug in to your local setting of firefox in your user home

 vladimir@shinsengumi ~/.mozilla/plugins $ pwd
 /home/vladimir/.mozilla/plugins 
 vladimir@shinsengumi ~/.mozilla/plugins $ ls -ltr
 lrwxrwxrwx 1 vladimir vladimir 60 Jan  1 23:06 libnpjp2.so -> /home/vladimir/Install/jdk1.6.0_32/jre/lib/amd64/libnpjp2.so