You can do this if you want to have total control of your Java jdk and learn how the package manager creates all of its configuration.
this was tested on ubuntu 10.10 x86_64 and with the 64 bit version of Firefox
so here it goes :)
Notes: be sure to unistall openJDK or any JRE/JDK you have previously installed
1. Install java
- Download official jdk .bin file (jdk-6u24-linux-x64.bin) from the java official site
- create a folder under /usr/local/src named tmp :
- move the .bin file to the folder you've just created
- go to that folder, then type:
chmod +x jdk-6u24-linux-x64.bin
this will make the.bin file into an executable file
- then execute the file:
this will create a folder named jdk1.0.6_24/
- move the folder jdk1.0.6_24/ one level up :
mv jdk1.0.6_24/ ../
- now you have two new folders under /usr/local/src:
- tmp/
- jdk1.0.6_24/
- erase the tmp folder along with the .bin file inside:
2. Tell the system where to find java
In ubuntu, under your home directory, there is a file called .bashrc to see this file:
- go to your home folder by typing '~' (without the quotes) in the console
- then type ls -a, this will list all files including hidden files .bashrc is a hidden file because it has a '.' preceding its name
- open this file with gedit or your preferred text editor :
gedit .bashrc
- add the following lines at the end of this file:
JAVA_HOME=/usr/local/src/jdk1.6.0_24
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=$JAVA_HOME/lib
to test what we did before:
- Reboot your pc, then open a terminal and type
It should appear some info about the java virtual machine
3. link java to your web browser (firefox) (taken from http://sites.google.com/site/easylinuxtipsproject/java#TOC-Removal1)
- remove the IcedTea plugin, if it has been installed.
sudo apt-get remove icedtea6-plugin
- close Firefox
work around 1
- go to the firefox plugin folder, mine is in
/usr/lib/firefox/plugins
- create a symbolic link to the file jdk1.6.0_24/jre/lib/amd64/libnpjp2.so
ln -s /usr/local/src/jdk1.6.0_24/jre/lib/amd64/libnpjp2.so
- open firefox and type in the address bar:
it should appear the description of the java files firefox uses
if it doesn't work here's the second option but first remove the symbolic link you created before
workaround 2
- go to your home folder:
- execute the following command, in order to create a certain folder (if it doesn't exist already).
- go to the folder you've just created:
cd ~/.mozilla/plugins
- Now you can install the plugin, by creating a symbolic link (you tell Firefox, where the plugin is located).
ln -s /usr/local/src/jdk1.6.0_24/jre/lib/amd64/libnpjp2.so
- open Firefox and type in the address bar
it should appear the description of the Java files Firefox uses
One good page to test if Java is enabled in Firefox is: http://www.myphysicslab.com there you can find some simulations written in Java and some applets that run through your installed Java plugin
Hope you enjoy your new fresh installation of Java jdk, see you next time
Buen aporte. Gracias por el post. Tenía dolores de cabeza con la versión de 64 bits. Saludos! :)
ResponderEliminar