Linux(Ubuntu)下給firefox安裝jre插件

做法
     下載jre,並解壓到某個文件夾!
     cd <firefox的安裝目錄>/plugins
     sudo ln -s <jre的安裝目錄>/lib/i386/libnpjp2.so      cd <mozilla>/plugins
     sudo ln -s <jre的安裝目錄>/lib/i386/libnpjp2.so
     重啓 firefox 。     和你之前查的不同? 有疑問的請往下看!!
 
     今天打開一個含有 Applet 小程序的網頁,發現少了傳說中的 plugin,去查找發現是: java runtime environment (jre)。 於是點擊安裝插件,提示失敗,要求手動安裝,並給你個jre下載地址。
       好吧,我還不會手動安裝呢!Google之。
       結論是再firefox安裝目錄裏創建一個符號鏈接即可,那麼:       cd <firefox的安裝目錄>/plugins
       sudo ln -s <jre的安裝目錄>/plugin/i386/ns7/libjavaplugin_oji.so       好吧,滿懷希望地重啓firefox,但是java的插件沒有。
       是不是操作錯了?於是 try again and again 。但是結果沒變。
       但是,我發現再 firefox 的 about:plugins 的頁面內展示的插件中有好多文件我再 <firefox>/plugins裏沒有見過。於是       cd /usr/lib
       ls -a | grep mozilla       發現再 mozilla裏也有個 plugins的目錄,接着按照上面的方法創建符號鏈接。
       重啓,失敗!!!
       糾結中…………
       怎麼回事呢?上官網。上面寫着Java Runtime EnvironmentVersion: 1.4.2 or later Supported Supported Java FAQ

Install Java Runtime Environment.Make a symbolic link to libjavaplugin_oji.so in your Mozilla Plugins directory. Use the copy located in the plugin/i386/ns7 directory of JRE 5.0 or later, or plugin/i386/ns610-gcc32 if you are using JRE 1.4.2.
Do not copy the plugin to your plugins directory. If you do, Mozilla will crash any time you attempt to view a page containing a Java applet.
The instructions listed here are for the Sun Java Runtime Environment. OtherJava Runtime Environments, such as those available from IBM and the Blackdown project, can also be used.
 
       既然官網都這麼說了,可能是哪兒操作錯了!於是又  try again and again, 於是在一次次的打擊中我想……       但是希望來了。
       我偶然得知這麼一個事實:MozillaFirefox 3.6 系列將不再支持以前 OJI (Open Java Virtual Machine Integration)架構 Java 瀏覽器插件,需要使用 Java 6 Updates 10 及以後提供的符合 NPAPI 標準的新版本瀏覽器插件。我們創建的符號鏈接應該是一個叫做 libnpjp2.so的庫,在jre/lib/i386裏。而不是之前的libjavaplugin_oji.so。好吧,官網把我忽悠了!     最終解決方案:
     cd <firefox的安裝目錄>/plugins
     sudo ln -s <jre的安裝目錄>/lib/i386/libnpjp2.so
     爲保險
     cd <mozilla>/plugins
     sudo ln -s <jre的安裝目錄>/lib/i386/libnpjp2.so
     重啓 firefox 。成功了!
    
      可能有些同志不知道怎麼操作:
      我的firefox安裝目錄是:/usr/lib/firefox (可以 whereis firefox),mozilla目錄是:/usr/lib/mozilla,jre安裝目錄在:/opt/jre1.6.0_22
      操作過程:
      cd /usr/lib/firefox/plugins
      ln -s /opt/jre1.6.0_22/lib/i386/libnpjp2.so
      cd ..
      cd ..
      cd mozilla/plugins
      ln -s  /opt/jre1.6.0_22/lib/i386/libnpjp2.so      重啓firefox!!!
      地址欄 about:plugins      圖片爲證:

http://www.huomo.cn/developer/article-15a76.html

http://www.oracle.com/technetwork/java/javase/manual-plugin-install-linux-136395.html

http://download.oracle.com/javase/6/docs/technotes/guides/jweb/applet/browser_support.html

http://jvarun.wordpress.com/2008/10/02/making-jre-work-in-firefox-suse-102-64-bit/
發佈了161 篇原創文章 · 獲贊 12 · 訪問量 26萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章