Ubuntu Forums Archive Viewer

HOWTO: Java64 with 64-bit Firefox plugin

Archived thread 1019314 from Outdated Tutorials & Tips. Markdown source: Outdated_Tutorials_&_Tips/thread_1019314_HOWTO_Java64_with_64-bit_Firefox_plugin.md

Original URL About this archive
#1

[CENTER]This tutorial was written specifically for Java 1.6.0_12, but should work fine on future revisions.[/CENTER]

Installing Java for 64-bit

Begin by downloading Java from Sun. Download Here (Linux x64 self-extracting JRE file)

or paste this command into the terminal:

wget -c 'http://www.java.net/download/jdk6/6u12/promoted/b02/binaries/jre-6u12-ea-bin-b02-linux-amd64-08_dec_2008.bin'

Next, we'll create an install directory in /opt (as this is probably the best place for development applications).

cd /opt
sudo mkdir java
cd java

Let's copy the installer file to the java directory.

sudo cp ~/jre-6u12-ea-bin-b02-linux-amd64-08_dec_2008.bin /opt/java/

Finally, let's execute the installer

sudo bash jre-6u12-ea-bin-b02-linux-amd64-08_dec_2008.bin

For good measure, let's register this as the default Java provider.

sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jre1.6.0_12/bin/java" 1
sudo update-alternatives --set java /opt/java/jre1.6.0_12/bin/java

Installing Firefox plugin First, lets remove the gcj web plugin:

sudo apt-get remove icedtea-gcjwebplugin

Remove the Cacao-plugin as described by Jozza the Wick:

sudo apt-get remove cacao-oj6-plugin

If it comes up with "not found" or the like, ignore it and continue.

Since we have it all setup, all we need to do is install the Firefox plugin. This can be done in one simple command (change according to version).

mkdir ~/.mozilla/plugins
ln -s /opt/java/jre1.6.0_12/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

deepclutch reported that this

sudo ln -s /opt/java/jre1.6.0_12/lib/amd64/libnpjp2.so /usr/lib/firefox-3.0.5/plugins/

worked instead. If this works for you, and the thanks system comes back up, all credit goes to him/her.

You can test the plugin by restarting your browser and going to http://www.javatester.org/version.html and checking for the pink box and line of text.

For Epiphany

ln -s /opt/java/jre1.6.0_12/lib/amd64/libnpjp2.so /usr/lib/epiphany-webkit/2.24/plugins/

by deepclutch

#2

i followed the guide, however

./jre-<miscellaneous version information> -amd64-<date>.bin

did not work, so i used

sudo sh ./jre-<miscellaneous version information> -amd64-<date>.bin

instead, and it doesn't work (java doesn't show up in firefox' addons manager, and javatester says it's disabled). did i do it wrong? regardless of wheter it's my fault or not, how can i repair it?

#3

Follow the last part "Installing Firefox plugin". And, well, I guess make sure you aren't using the default text I provide, as anything in <> are just placeholders for the actual program. Such as mine was

./jre-6u12-ea-bin-b02-linux-amd64-08_dec_2008.bin

You probably already get that, but for anybody who doesn't, there it is.

#4

nice one, java was my last reason for sticking to a 32 bit OS. Would it be easier to put ``` wget -c 'http://www.java.net/download/jdk6/6u12/promoted/b02/binaries/jre-6u12-ea-bin-b02-linux-amd64-08_dec_2008.bin'

#5

SuperSonic4 said: nice one, java was my last reason for sticking to a 32 bit OS.

Would it be easier to put ``` wget -c 'http://www.java.net/download/jdk6/6u12/promoted/b02/binaries/jre-6u12-ea-bin-b02-linux-amd64-08_dec_2008.bin'

Could, but I find it better if people download the latest build than to stick themselves with just one.

Come to think of it, I'll change it. It could make the guide a bit easier to read.
#6

Nice write up. I told the sun-java maintainer about it as a heads up for future update. This update actually works at http://www.pogo.com

BTW, never try to predict ("should work...") the future unless you have a crystal ball that's in good shape! :popcorn:

#7

lemon8h8ead said: Nice write up. I told the sun-java maintainer about it as a heads up for future update. This update actually works at http://www.pogo.com

BTW, never try to predict ("should work...") the future unless you have a crystal ball that's in good shape! :popcorn: Thanks, and my crystal ball only has a few cracks ;)

#8

How do you undo this and change IcedTea to be the default, again? I installed Sun Java, but Runescape still won't run under it. ^.^;

#9

run sudo update-alternatives java and choose the one you want.

#10

Okay ... *does so* It just tells me

update-alternatives: unknown argument `java'
#11

Sorry,

sudo update-alternatives --config java and sudo update-alternatives --config javac

#12

libnpjp2.so

File name: libnpjp2.so

MIME Type Description Suffixes Enabled application/x-java-vm Java Yes application/x-java-applet Java Yes application/x-java-applet;version=1.1 Java Yes application/x-java-applet;version=1.1.1 Java Yes application/x-java-applet;version=1.1.2 Java Yes application/x-java-applet;version=1.1.3 Java Yes application/x-java-applet;version=1.2 Java Yes application/x-java-applet;version=1.2.1 Java Yes application/x-java-applet;version=1.2.2 Java Yes application/x-java-applet;version=1.3 Java Yes application/x-java-applet;version=1.3.1 Java Yes application/x-java-applet;version=1.4 Java Yes application/x-java-applet;version=1.4.1 Java Yes application/x-java-applet;version=1.4.2 Java Yes application/x-java-applet;version=1.5 Java Yes application/x-java-applet;version=1.6 Java Yes application/x-java-applet;jpi-version=1.6.0_12 Java Yes application/x-java-bean Java Yes application/x-java-bean;version=1.1 Java Yes application/x-java-bean;version=1.1.1 Java Yes application/x-java-bean;version=1.1.2 Java Yes application/x-java-bean;version=1.1.3 Java Yes application/x-java-bean;version=1.2 Java Yes application/x-java-bean;version=1.2.1 Java Yes application/x-java-bean;version=1.2.2 Java Yes application/x-java-bean;version=1.3 Java Yes application/x-java-bean;version=1.3.1 Java Yes application/x-java-bean;version=1.4 Java Yes application/x-java-bean;version=1.4.1 Java Yes application/x-java-bean;version=1.4.2 Java Yes application/x-java-bean;version=1.5 Java Yes application/x-java-bean;version=1.6 Java Yes application/x-java-bean;jpi-version=1.6.0_12 Java Yes application/x-java-vm-npruntime Java Yes

Is what I gots under about:plugins

But it don't worky. I go to the test java web page and it's says it don't work.

Help says I gots this: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.19) Gecko/20081216 Ubuntu/8.04 (hardy) Firefox/2.0.0.19

I downloaded this from a java https page:

/home/ray/jre-6u12-ea-bin-b03-linux-amd64-22_dec_2008.bin

when I installed it, it showed up here: /home/ray/jre1.6.0_12

and I linked to /usr/lib64/mozilla-firefox/plugins

using:

sudo ln -s /home/ray/jre1.6.0_12/lib/amd64/libnpjp2.so

In a terminal at /usr/lib64/mozilla-firefox/plugins

So why don't it work? I got lots of time for exersizes in futility.

later ray

#13

raypsi said: libnpjp2.so

File name: libnpjp2.so

MIME Type Description Suffixes Enabled application/x-java-vm Java Yes application/x-java-applet Java Yes application/x-java-applet;version=1.1 Java Yes application/x-java-applet;version=1.1.1 Java Yes application/x-java-applet;version=1.1.2 Java Yes application/x-java-applet;version=1.1.3 Java Yes application/x-java-applet;version=1.2 Java Yes application/x-java-applet;version=1.2.1 Java Yes application/x-java-applet;version=1.2.2 Java Yes application/x-java-applet;version=1.3 Java Yes application/x-java-applet;version=1.3.1 Java Yes application/x-java-applet;version=1.4 Java Yes application/x-java-applet;version=1.4.1 Java Yes application/x-java-applet;version=1.4.2 Java Yes application/x-java-applet;version=1.5 Java Yes application/x-java-applet;version=1.6 Java Yes application/x-java-applet;jpi-version=1.6.0_12 Java Yes application/x-java-bean Java Yes application/x-java-bean;version=1.1 Java Yes application/x-java-bean;version=1.1.1 Java Yes application/x-java-bean;version=1.1.2 Java Yes application/x-java-bean;version=1.1.3 Java Yes application/x-java-bean;version=1.2 Java Yes application/x-java-bean;version=1.2.1 Java Yes application/x-java-bean;version=1.2.2 Java Yes application/x-java-bean;version=1.3 Java Yes application/x-java-bean;version=1.3.1 Java Yes application/x-java-bean;version=1.4 Java Yes application/x-java-bean;version=1.4.1 Java Yes application/x-java-bean;version=1.4.2 Java Yes application/x-java-bean;version=1.5 Java Yes application/x-java-bean;version=1.6 Java Yes application/x-java-bean;jpi-version=1.6.0_12 Java Yes application/x-java-vm-npruntime Java Yes

Is what I gots under about:plugins

But it don't worky. I go to the test java web page and it's says it don't work.

Help says I gots this: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.19) Gecko/20081216 Ubuntu/8.04 (hardy) Firefox/2.0.0.19

I downloaded this from a java https page:

/home/ray/jre-6u12-ea-bin-b03-linux-amd64-22_dec_2008.bin

when I installed it, it showed up here: /home/ray/jre1.6.0_12

and I linked to /usr/lib64/mozilla-firefox/plugins

using:

sudo ln -s /home/ray/jre1.6.0_12/lib/amd64/libnpjp2.so

In a terminal at /usr/lib64/mozilla-firefox/plugins

So why don't it work? I got lots of time for exersizes in futility.

later ray You should probably follow as above and install it to your /opt directory (best place for development stuff). Once there, just link it to your home directory firefox preferences. That way, firefox will detect the plugin from the user directory. This way, it breaks a bit less and you shouldn't have as much problems ;)

#14

Well tanks alot I couldn't get the default provider to worky it had a sytax error of sum kink. But after the firefox 64 bit updated from auto update it worked fine following ur instructions. Although I got the java from here: https://jdk6.dev.java.net/6uNea.html Which provides a 22 dec 2008 dated version I didn't notice the date difference but I got it all worked out tanks agin.

later ray

#15

This is brilliant .. I have had java problems for the last six months and now they are fixed. But I had to remove my previous attempts to get this to work. In particular, after I had followed the steps in the post, I removed the old icedtea gcjwebplugin using

sudo apt-get remove icedtea-gcjwebplugin
#16

ready.eddy said: This is brilliant .. I have had java problems for the last six months and now they are fixed. But I had to remove my previous attempts to get this to work. In particular, after I had followed the steps in the post, I removed the old icedtea gcjwebplugin using

sudo apt-get remove icedtea-gcjwebplugin

Thanks, I'll add that.

#17

thanks.it is useful.

#18

Thanks very much for the useful HOWTO. It worked like a charm for me.

#19

Thank you very much, just the post I've been looking for. Works like a charm !

UBUNTU ROCKS !

:guitar:

#20

i did all the steps in the tutorial but firefox still does not recognize java!

#21

Could you give me the output of ``` ls ~/.mozilla/plugins/

#22

sure:

varg@varg-desktop:~$ ls ~/.mozilla/plugins/
libnpjp2.so
#23

Hmm... is firefox 32-bit by any chance? This is probably a stupid question, but might as well eliminate the easy ones first.

#24
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.5) Gecko/2008121623 Ubuntu/8.10 (intrepid) Firefox/3.0.5

pretty sure it is 64bit

#25

Last thing I can think of is: Did you make sure to run the sudo update-alternatives part? I can't remember off the top of my head if that involves firefox or not, but it's worth a try.

#26

Frak said: Last thing I can think of is: Did you make sure to run the sudo update-alternatives part? I can't remember off the top of my head if that involves firefox or not, but it's worth a try.

i did everything in tutorial step by step but ffox still doesnt recognize sun java. i guess i'll use it with other plugins that ffox offers.

#27

Hey, thanks, this worked like a charm! One note though, if you're using the jdk isntead of the jre, the plugin is in a different spot. It's at

/opt/java/jdk1.6.0_12/jre/lib/amd64/libnpjp2.so

#28

What happens when it comes time to update the java plugin? You just do the same steps for a newer version?

These guides never seem to cover updating. :\

#29

well i installed xubuntu and it somehow worked on that :S

#30

xoros said: What happens when it comes time to update the java plugin?

You just do the same steps for a newer version?

These guides never seem to cover updating. :\

Just do it again. If you want to be scrupulously clean, you could remove the old directory.

gaffurabi said: well i installed xubuntu and it somehow worked on that :S

:o :)

#31

for me ,it is ``` ln -s /opt/java/jre1.6.0_12/lib/amd64/libnpjp2.so /usr/lib/firefox-3.0.5/plugins/


and if you need a gui for update-alternatives:
**apt-get install galternatives **
--
Bye for now :)
#32

gaffurabi said: i did everything in tutorial step by step but ffox still doesnt recognize sun java. i guess i'll use it with other plugins that ffox offers.

Hi, not sure if you got this solved, but for me the same thing happened, I traced it down to linking the wrong file (in nautilus my ~/.mozilla/plugins showed a broken link). Maybe you might want to check that out.

Thanks to the OP for this useful thread.

#33

ok whoever has the broken link problem I found the solution.

You have to be in the ~/.mozilla/plugins folder and make the link from there. Don't know why but it worked.

After you have completed the instructions and you are at the link part do:


cd ~/.mozilla/plugins
ln -s /opt/java/jre1.6.0_*/lib/amd64/libnpjp2.so

Restart firefox and you are done.

Also if you still have problems check if you have given execution rights in the bin folder.

Do


cd /opt/java/jre1.6.0_*/bin
chmod +x *

I saw that at the sun site here http://download.java.net/jdk6/

#34

Thank you Frak!

I installed also the new version jre1.6.0_14 using your HOWTO and now with the newer version also RunEscape works. The last reason why I have been using 32bit java.

When doing it to my desktop PC I didn't remove the older version and the browser plugin did not work. Also the java page didn't regocnice that I was using jre1.6.0_14.

So it's best to remove old version first and also the java-plugin link!;) I did it to my laptop just couple of minutes ago and installed the jre 1.6.0_14 and the java and the browser plugin works fine!!

This really rocks! Thanks!:guitar:

with ligth junnuh

#35

Was trying Epiphany-webkit(from ppa repo) .to have the epiphany java plugin:

ln -s /opt/java/jre1.6.0_12/lib/amd64/libnpjp2.so /usr/lib/epiphany-webkit/2.24/plugins/ 
#36

From another thread, I found that I had to run this command to remove another component of the IceTea plugin

sudo apt-get remove cacao-oj6-plugin

http://ubuntuforums.org/showthread.php?p=7199723#post7199723

Maybe you could add that to the guide? Thanks so much for helping me get Java running!

#37

Thanks! Added.

#38

as deepclutch said, but with the sudo: ``` sudo ln -s /opt/java/jre1.6.0_14/lib/amd64/libnpjp2.so /usr/lib/firefox-3.0.10/plugins/


;)

Excellent guide!
Thx
#39

worked like a charm!

Thanks

#40

[COLOR=Red]_UPDATE:_[/COLOR] Jre7 Experimental versions are available. For Extracting .jar archive ,sun-java-6 jre/bin needs to be installed

 /usr/lib/jvm/java-6-sun/jre/bin/java -jar  jre-7-ea-bin-b78-linux-x64-17_dec_2009.jar

http://download.java.net/jdk7/binaries/ _64-bit:_ http://www.java.net/download/jdk7/binaries/jre-7-ea-bin-b78-linux-x64-17_dec_2009.jar

the extracted jre1.7.0 is placed at /opt directory.

cd /opt/jre1.7.0/bin;chmod +x * 

you have to symlink :

sudo ln -sf /opt/jre1.7.0/lib/amd64/libnpjp2.so /usr/lib/firefox/plugins/ 
sudo ln -sf /opt/jre1.7.0/lib/amd64/libnpjp2.so /usr/lib/firefox-3.5.1/plugins/ 
sudo ln -sf /opt/jre1.7.0/lib/amd64/libnpjp2.so /usr/lib/firefox-addons/plugins/ 

Incase ,No Java variable is defined with update-alternatives(in case no other java installed) ,Run this :

 **update-alternatives --install /usr/bin/java java /opt/jre1.7.0/bin/java 50**
#41

Nublet said: i followed the guide, however

./jre-<miscellaneous version information> -amd64-<date>.bin

did not work, so i used

sudo sh ./jre-<miscellaneous version information> -amd64-<date>.bin

instead, and it doesn't work (java doesn't show up in firefox' addons manager, and javatester says it's disabled). did i do it wrong? regardless of wheter it's my fault or not, how can i repair it? The reason that did not work is because the file was not marked as executable :)

#42

(I have Jaunty 9.04 amd64 Firefox 3.5). That procedure worked partially for me.

I am able to get Java Test to work.

http://www.javatester.org/version.html

And Java Web Start works.

http://java.sun.com/javase/technologies/desktop/javawebstart/apps/draw.jnlp

But the Java Web Start on the Java F/X page gets 'Unable to Launch the Application' at:

http://javafx.com/samples/BrickBreaker/index.html <click 'launch'>

and any of the sample Java F/X programs don't load either at:

http://www.javafx.com/samples/ProjectManager/index.html

However, the above two errant links work on Firefox 3.5 and IE on Win/XP.

#43

Same problem here. Although once in a while I discover JavaFX applets or web-starts that work.

However, the javatester does not tell you everything so run this program instead.

import java.util.Properties;

public class ListSystemProperties {

/** * @param args * @throws Exception */ public static void main(String[] args) throws Exception { Properties props = System.getProperties();

props.storeToXML(System.out, "Show me all properties!"); }

}

I did use the package manager to get the sun-java6 package and got the following: <entry key="java.endorsed.dirs">/usr/lib/jvm/java-6-sun-1.6.0.14/jre/lib/endorsed</entry> <entry key="os.arch">amd64</entry>

So it is as simple as that, use the package manager. But it doesn't help the JavaFX problem with amd64.

#44

Perfect!

Gotta restart Firefox to take effect!

#45

I've written an even more "dumbed down" how-to for 64 bit: http://sites.google.com/site/easylinuxtipsproject/java#TOC-HOW-TO-FOR-64-BIT-UBUNTU-9.10

Only knowledge required is how to use copy/paste. :)

#46

worked like a charm, thanks. these web forums makes linux life easier for folks like me...:)