Hi all, I am going to start explaining what I did to install the oracle/Java jdk
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 installed1. 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 :
mkdir /usr/local/src/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
./jdk-6u24-linux-x64.bin 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:
rm -r tmp/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/libto test what we did before:
- Reboot your pc, then open a terminal and type
java -version
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 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:
about:plugins 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
cd ~- execute the following command, in order to create a certain folder (if it doesn't exist already).
mkdir ~/.mozilla/plugins - 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
about:plugins 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