Installing Java on Ubuntu Linux
Edit /etc/apt/sources.list and add in the following lines (if they are not present already)
$ vi /etc/apt/sources.list
deb http://ca.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse
deb-src http://ca.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverseSometimes, these lines may be commented out in which case you need to uncomment these two lines. Then save the file.
Now get an update, by issuing the command$ sudo apt-get update
To install java,
$ sudo apt-get install sun-java6-jdk
There will be a couple of questions that will be asking during the installation process which when when answered installs the product on your server.
To check if java has been installed in your machine, you can type
$ java -version
and, you will get an output like
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)Now check if /usr/lib/jvm/java-6-sun is present in the JVM list, else add it to the top
$ sudo vi /etc/jvm
.
.
/usr/lib/jvm/java-6-sun
.
.
This completes the java installation to the point that the applications can now be executed on linux box.