Java for browser install

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.

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.

Читайте также:  Backend сервисы на python

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.

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.

Источник

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.

Читайте также:  Css horizontal scroll width

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,

Читайте также:  Php paths and directories

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

Источник

Как включить Java в Firefox

Многие пользователи испытали трудности с отсутствием Java в новых версиях браузера Mozilla Firefox. Это связано с тем, что разработчики прекратили поддержку практически всех плагинов. К счастью, всегда можно вручную скачать и запустить Java-плагин. В этом руководстве мы рассмотрим подробно этот процесс.

Учтите, что Java-плагин нельзя установить и запустить в 64-битной версии Mozilla Firefox.

Помните, что JavaScript и Java – это две разные технологии.

Шаг 1. Загрузка Java-плагина

Запускаем Mozilla Firefox, переходим на официальный сайт Java и жмем на кнопку Загрузить Java бесплатно:

Далее кликаем на Согласиться и начать бесплатную загрузку:

Сохраняем файл и запускаем его:

Шаг 2. Установка Java-плагина

Выбираем Install:

Ждем, пока завершится процесс установки. Если у вас уже установлена старая версия плагина, то появится окно, в котором вы можете удалить его, нажав на кнопку Uninstall:

Старый плагин был удален, нажимаем на Next:

Все, новая версия Java-плагина установлена, жмем на Close:

Шаг 3. Включение Java

Перезапускаем браузер. Открываем вкладку ИнструментыДополнения:

Во вкладке Плагины ищем Java(TM) Platform SE и выставляем значение Включать всегда:

Шаг 4. Добавление сайтов в список исключений

Начиная с Java 8, разработчики внедрили стандарт, который блокирует многие небезопасные игры и приложения на Java. Если вы все равно хотите запустить их, то придется воспользоваться списком исключений. Для его вызова открываем меню ПускПанель управления → указываем в поисковой строке Java → выбираем Java Control Panel:

Переключаемся на вкладку Security и выбираем опцию Edit Site List:

Жмем кнопку Add:

Указываем адрес веб-сервиса или игры, которую вы хотите запустить в обход стандартов безопасности Java:

Кликаем на Continue:

Кликаем на OK в Java Control Panel. Теперь при запуске этого Java-апплета вас попросят дать разрешение. Жмем на кнопку Run, чтобы запустить игру или веб-сервис:

Источник

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