I actually prefer method #2 but I already made it and if you already tried removing OpenJDK the first method may be helpful to some.
Method 1: Removing OpenJDK and installing Suns version
So first let's get it current by updating everything run these one at a time
- Code: Select all
sudo apt-get update
sudo apt-get upgrade
Restart firefox and check the version of Java it shows the link here:
http://www.java.com/en/download/installed.jsp
Does it say: Version 6 Update 20
If it does then skip to step 2 below
Step 1 a
Now according the the release notes for Lucid Sun Java moved to the Partner repository.:
And this will enable that repo.
- Code: Select all
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
Then to update and upgrade again run these one at a time
- Code: Select all
sudo apt-get update
sudo apt-get upgrade
Does it say: Version 6 Update 20
If it does then skip to step 2 below
Step 1 b
Now for some reason I have Version 6 Update 20 and I do NOT have the partner repo. enabled. But I have enabled the Medibuntu repo. so if enabling the partner repo. did not bring sun java current then it's worth a shot and wont harm anything to enable it like this:
- Code: Select all
sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update
That included the update command now to just upgrade packages.
- Code: Select all
sudo apt-get upgrade
You should definitely have the Version 6 Update 20 now.
Restart firefox and check to be sure.
Step 2
May have found the fix for java
- Code: Select all
sudo apt-get install libstdc++5
It will say it can't be authenticated. It will be ok to install it anyway. It installs nothing else (no additional dependencies).
It can be removed if it doesn't work with
- Code: Select all
sudo apt-get remove libstdc++5
Documentation of sun java JRE6 requiring it here:
http://bugs.sun.com/bugdatabase/view_bu ... id=6542512
Problem is libdeploy.so in Java 6 or above depends on libstdc++.so.5
Im' the same of both machines 64 bits and 32 bits, and i 'have solved the JAVA APPLETS problem on Debian Etch 4.0 32 bits installed on a AMD64 MACHINE. This is how to...
#apt-get install libstdc++5
It's a bit dated but you know how old bugs come back to haunt sometimes.
You may need to reboot for it to take affect.
Method 2: Having OpenJDK and Sun Java installed and using Suns version
For some reason when removing OpenJDK it may want to remove other things which it shouldn't so this is how you can have both installed and set it to use the Sun version.
According the the release notes for Lucid Sun Java moved to the Partner repository.:
And this will enable that repo.
- Code: Select all
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
I seem to get the most recent sun java version with the medibuntu repo. enabled so let's enable it since it wont hurt to have it enabled.
- Code: Select all
sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring && sudo apt-get --quiet update
That included the update command now to just upgrade packages.
- Code: Select all
sudo apt-get upgrade
Now open Synaptic
System > Administration > Synaptic Package Manager
Click on Reload then search for openjdk and any of these that are not installed mark them for installation, any that are installed mark them for re-installation.
then search for sun-java and do the same thing with these
Also search for libstdc++5 and mark it for installation since Suns Java 6 needs it as explained earlier in method 1.
Click Apply and close Synaptic when finished and run:
- Code: Select all
sudo update-java-alternatives -l
Which should return something like this
java-6-openjdk 1061 /usr/lib/jvm/java-6-openjdk
java-6-sun 63 /usr/lib/jvm/java-6-sun
Now openjdk is set as default and we want to set it to suns version with this
- Code: Select all
sudo update-java-alternatives -s java-6-sun
Hopefully it wont return anything which means it worked without any errors.
Close firefox and reboot then test it here by clicking on the Verify java version button:
Sun Java Test Page
It should say this
Congratulations!
You have the recommended Java installed (Version 6 Update 20).
Hopefully all of this will go without a hitch.