Java для firefox linux

Установка JAVA

Первое, что нужно сделать — это с помощью браузера зайти на сайт java.com и скачать подходящую, 32-х битную или 64-битную, версию Oracle Java для Linux. Скачиваем архив в формате tar.gz. На выходе должно получиться нечто похожее на jre-8u45-linux-x64.tar.gz. После окончания загрузки откройте эмулятор терминала и авторизуйтесь в качестве суперпользователя.

Создайте пустую папку в каталоге /opt/java/$, подставляя в $ версию Oracle Java, которую вы скачали:

Перейдите в свеже созданный каталог:

Распакуйте архив с Oracle Java из каталога, в который ваш браузер его поместил. Скорее всего он располагается в папке Downloads в вашем домашнем каталоге:

И наконец удалите архив — он нам больше не нужен

Однако, для быстрого доступа к исполняемым файлам Oracle Java, стоит сделать символические ссылки (ярлыки) на них в каталоге /usr/bin:

# for i in \
$(find /opt/java/$ -type f -executable)
do ln -svi $ /usr/bin
done

Проверить, все ли сделано правильно можно введя команду

Эта команда позволяет узнать версию java. Если выводом команды будет та версия Oracle Java, которую вы ожидали увидеть, то все прошло хорошо. Аналогично производится и обновление Oracle Java на Linux. Вы просто скачиваете новый архив, распаковываете, заменяете символические ссылки. Удалять старый каталог или нет — решать вам.

Несколько слов о JAVA_HOME. Некоторые приложения, а точнее их скрипты запуска, вместо того, что адрессовать Java, используя переменную окружения $, используют переменную окружения $. Соответственно во избежания проблем, лучше эту переменную установить. Сделать это не сложно — нужно поместить в каталог /etc/profile.d/ файл с названием java.sh (имя значения не имеет, а вот расширение должно быть обязательно «.sh») следующего содержания, заменяя $ на ту версию Oracle Java, которую вы устанавливаете:

П.с. если вы ищите образ Oracle Java для запуска в docker, загядывайте на наш Docker Hub. Там вы найдете готовы образы и Dockerfile’ы

Установка Java plugin для браузера

Если вы в процессе работы наткнулись на сообщения вида «для вашего браузера не установлен java plugin» или «установите java plugin», то этот раздел для вас. Данное сообщение говорит нам о том, что браузер не может самостоятельно обработать запрашиваемый контент и нуждается в расширении — Java плагине. Но, как вы наверное знаете, поддержка NPAPI плагинов была удалена из Google Chrome, начиная с версии 35, и из Mozilla Firefox, начиная с версии 52. А java plugin как раз использует интерфейс NPAPI.

Читайте также:  Linux время установки системы

Для решения этой проблемы вы либо скачиваете и отдельно устанавливаете старую версию Firefox или Chrome и устанавливаете java plugin туда, либо можете воспользоваться одним из браузеров, поддерживающих NPAPI. Среди них PaleMoon — небезызвестный форк Firefox, и Midori — отличный легковесный браузер на движке WebKit.

Приведенная ниже инструкция будет работать как для Pale Moon любых версий, так и для Midori и Firefox версии 52 и ниже. Установка Java plugin’а заключается в простом создании символической ссылки (ярлыка) на плагин из каталога, в который вы установили Oracle Java.

# ln -svi \
/opt/java/$/lib/amd64/libnpjp2.so \
/usr/lib/mozilla/plugins/

Иногда вам придется произвести еще одно маленькое действие, если ваш дистрибьютер не позаботился о правильном задании переменных окружения. После установки браузера — перелогинтесь (выйтиде/зайдите в систему) и проверьте в терминале, установлена ли переменная окружения MOZ_PLUGIN_PATH

$ env | grep MOZ_PLUGIN_PATH

Результатом выполнения этой команды должно быть что-то вроде «/usr/lib/mozilla/plugins» — то место, где мы создавали символическую ссылку. Если вывод пустой, то добавьте в каталог «/etc/profile.d/» файл с названием, например «mozilla-common.sh» точно так, как мы это делали на этапе установки переменной окружения JAVA_HOME. Только, соответственно вместо JAVA_HOME мы устанавливаем переменную MOZ_PLUGIN_PATH:

После перелогинтесь. Запустите Pale Moon, Midori или Firefox, Откройте специальную страницу-тестер. Она поможет проверить корректноть установки java plugin и в случае успеха отобразит текущую версию Oracle Java.

Источник

How to install the Java plugin for Firefox?

I am trying to install Java and plugins for Firefox. I installed both the JDK and JRE. When I try with the sudo update-alternatives —config java command it shows only one choice available. Plugins are not usable in Firefox.

To me it is not clear what your problem is. Is java functioning properly? Can you compile and run java programmes?

As far as I understand you have installed jdk, jre and the browser plugins (icedtea). But you can’t use the plugins, can you explain further what the problem is? Are you getting an error? Btw, you can uninstall (Remove) and re-install IcedTea at the Software Centre.

@Seth but you want OP to read through all of that for something that can be solved in 1 line? The other is an overkill answer, the question is just «how to install Java?» while this is «how to install Java browser plugin for firefox?», those are different questions and can’t be merged.

I agree with @Braiam above. This is a different question because updating the Java version used by firefox is not the same as simply installing java. I personally have oracle Java 6, 7, and 8 JDKs but installing icedtea did nothing for my firefox. I had to follow these instructions with a JRE downloaded from java.com. Then firefox was happy.

Читайте также:  Linux прокси dns сервер

7 Answers 7

If you are using a version after 52 (not ESR), which disabled NPAPI, you are out of luck. If you are using one prior, which you absolutely wouldn’t want to, you can install the OpenJDK JRE, which would allow you to execute Java binaries locally using the java binary. This however, isn’t enough to execute Java web applets on your browser, which can be accomplished by installing the Icedtea plugin:

sudo apt-get install icedtea-plugin 

Then go to about:addons , in the plugin section, check if the plugin is enabled. Mozilla disables insecure plugins by default, that means that Java is disable even after installation due security concerns. You need to activate it before using it.

@kikicarbonell unless Ubuntu is something different, that package should be installed along with icedtea-plugin.

not for my case @Braiam. I have Ubuntu 14.04 and open-jdk installed. but if only execute your command my Firefox not execute java applet. Later, I try to execute apt-get install default-jre and firefox problems was solved.

Installing the IcedTea Java plugin:

To install the IcedTea Java plug-in, open a terminal and type:

sudo apt-get install icedtea-7-plugin 

Install the Firefox plug-in — Oracle

Remove the IcedTea plugin, if it has been installed.

sudo apt-get remove icedtea6-plugin 

Remove a former version of the Java plugin (may or may not be present)

rm ~/.mozilla/plugins/libnpjp2.so 

Now you can install the plugin, by creating a symbolic link (you tell Firefox where the plugin is located). For 32-bit Java, use

ln -s /usr/lib/jvm/jre1.7.0/lib/i386/libnpjp2.so ~/.mozilla/plugins/ 
ln -s /usr/lib/jvm/jre1.7.0/lib/amd64/libnpjp2.so ~/.mozilla/plugins/ 

Confirm that the JRE has been successful by using the official Oracle website.

Beginning in Firefox version 52, support for NPAPI plugins (java applets) in Firefox has ended, due to performance and security issues, the way that I manage to run java applets is to install the Extended Support Release (ESR) of firefox.

If you just downloaded and installed java jdk from oracle, then, let’s say you have installed jdk-8u91-linux-x64.tar.gz on

Then you’ll have a directory like:

All you have to do is go to your ubuntu firefox plugins directory and create a link:

$: cd /usr/lib/firefox-addons/plugins/ $: sudo ln -s /my/java/directory/jdk1.8.0_91/jre/lib/amd64/libnpjp2.so 

With Firefox 50 on Ubuntu 16.04.1, I found that directory didn’t exist. Other plugins like IcedTea created symlinks in /usr/lib/mozilla/plugins .

This is an old thread, but I stumbled upon it while googling a solution to my problem today. I figured someone else might be in the same situation.

Читайте также:  Return code 127 in linux

I need in-browser Java for legacy work-related websites, and the oracle java plugin does not cut it. After a long trial-and-error approach, I got IcedTea working consistently in an older version of firefox like this:

  • Download a tar of Firefox, version 51 (newer version don’t support the plugin)
  • Install the OpenJDK (7 or 8)
  • Install the icedtea—plugin and the icedtea-plugin
  • Now your openJDK installation will contain a IcedTeaPlugin.so file in the jre/lib folder
  • copy this to the mozilla/firefox plugin folders (I couldn’t figure out which one to copy it too, so I just copied it to anything firefox/plugins or mozilla/plugins)
  • start your old firefox version
  • verify the plugin is active (check about:plugins)

One of my colleagues created a script to remove the old firefox, and untar it on every run. That way it never gets updated accidentally. Be sure not to do this with your main firefox application.

Its been a battle, especially since I went through this a couple of months ago with 14.04, forgot the solution, upgraded to 16.04.

It is different I had Iced-tea and Oracle working under firefox in 14.04. I actually prefer Oracle (not generally but my use almost requires it) so I only have that now. I did not attempt any multiple installs or repositories. Symlinks as per most of the instructions out there are no good either.

In the end, in Firefox went to Edit—> Preference—>Applications then scrolled down to the JNLP file extension and picked «Use other. » from the drop down menu. Then found javaws from the relevant directory.

It is only a workaround, and Im not sure if it will suit your needs. Keep in mind most plugins will be deaded by March.

Источник

Sc0rp1us

Блог о Linux/Unix, Виртуализации, настройке сервисов, и инновационных технологиях.

Страницы

пятница, 13 января 2012 г.

Установка Java Plugin для Firefox в Linux

Этот способ подходит для большинства Linux систем, за исключением Ubuntu, для неё воспользуйтесь статьёй [Установка JRE и Java Plugin для Firefox в Ubuntu]

  • Linux (self-extracting file) — если у вас 32х битная система
  • Linux x64 * — если у вас 64х битная система
cd ~/get # перейдём в директорию в которую мы установили JRE ls jre-* # посмотрим как называется файл jre-6u30-linux-i586.bin # chmod +x jre-6u30-linux-i586.bin # сделаем его исполняемым ./jre-6u30-linux-i586.bin # и выполним 
mkdir ~/.mozilla/plugins/ cp `find ./dir/ -type f -name libnpjp2.so` ~/.mozilla/plugins/ 

Осталось перезапустить firefox

Протестировать работоспособность Java Plugin можно тут.

Источник

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