Linux: Installing sun-java 6u2 the Debian way on Ubuntu Dapper
Even though the recent changes in Sun's licensing, for distributing the jdk as a package, allows Ubuntu to provide prepackaged jdk's, I couldn't find a package for my Dapper install. On the dutch Ubuntu forums there was someone asking for a package for jdk 6u2, so I decided to give him a hand. This is the procedure that will work on Dapper, Edgy and Feisty:
Voila.
- sudo apt-get install java-package
- now edit: gksudo gedit /usr/share/java-package/sun-j2sdk.sh
- search this section:
"jdk-1_5_0_"[0-9][0-9]"-linux-i586.bin") # SUPPORTED
j2se_version=1.5.0+update${archive_name:10:2}
j2se_expected_min_size=130
found=true
;;
esac
;; - make it look like this:
"jdk-1_5_0_"[0-9][0-9]"-linux-i586.bin") # SUPPORTED
j2se_version=1.5.0+update${archive_name:10:2}
j2se_expected_min_size=130
found=true
;;
"jdk-6u"[0-9]"-linux-i586.bin") # SUPPORTED
j2se_version=1.6.0+update${archive_name:6:1}
j2se_expected_min_size=58
found=true
;;
esac
;; - copy: sudo cp -r /usr/share/java-package/sun-j2sdk1.5 /usr/share/java-package/sun-j2sdk1.6
- edit: gksudo gedit /usr/share/java-package/sun-j2sdk1.6/install and replace j2sdk1.5-sun by j2sdk1.6-sun
- edit: gksudo gedit /usr/share/java-package/sun-j2sdk1.6/remove and replace j2sdk1.5-sun by j2sdk1.6-sun
- download: jdk-6u2-linux-i586.bin
- execute install: fakeroot make-jpkg ./jdk-6u2-linux-i586.bin
- this results in a .deb that you can install using sudo dpkg -i ./sun-j2sdk1.6_1.6.0+update2_i386.deb
Voila.
Comments
Tot ziens,
Herman (vanuit AXA)
De tweeling wordt maandag (27/08) geboren, dus dat wordt nog even afwachten.
Tot ziens.
sudo update-alternatives --config java
and choose the new version as default...
Thanks for posting!
Paris