Install java using deb package in Ubuntu
Nowadays Java seems to be the most popular application development platform because of its portability and availability of APIs. Anyway, standard Java by Sun only provides pre-package version in RPM format and tar format. In order to install this package on other Linux distros like Ubuntu, deb package should be constructed for easily managing the package later. Fortunately, Ubuntu offers lots of tools to automate these tasks. For a fresh Ubuntu, you can follow below instruction to install Java properly.
- Edit /etc/apt/sources.list to include multiverse by adding below lines
deb http://archive.ubuntu.com/ubuntu breezy universe multiverse deb-src http://archive.ubuntu.com/ubuntu breezy universe multiverse
- Update repository
apt-get update
- Install necessary packages
apt-get install fakeroot java-common java-package build-essential
- Download Java 2 Platform, Standard Edition, v1.5.0 (J2SE) SDK from http://java.sun.com/j2se/1.5.0/download.html
- Move the downloaded file, jdk-1_5_0_06-linux-i586.bin to temporary directory
- Run java-package as follow (you must not be root)
fakeroot make-jpkg jdk-1_5_0_06-linux-i586.bin
- Install the result the deb package, sun-j2sdk1.5_1.5.0+update06_i386.deb
dpkg -i sun-j2sdk1.5_1.5.0+update06_i386.deb
- Choose java if you have more than one alternative
update-alternatives --config java
- set JAVA_HOME environment to /usr
export JAVA_HOME=/usr
- Verify installation as follow
java -version
That’s all! You can manage this java package like other packages in Ubuntu and Debian.
Technorati Tags: English, Software, Linux, Tips and Tricks, Ubuntu, Java, JDK, Debian
- sugree's blog
- 2129 reads
Post new comment