Thursday, November 12, 2009

Installing Java in Ubuntu Linux

One of the reasons I love Ubuntu (Linux) is because it comes with a great number of packages.

Ubuntu has the following Java packages

sun-java6-bin – Contains the binaries
sun-java6-demo – Contains demos and examples
sun-java6-doc – Contains the documentation
sun-java6-fonts – Contains the Lucida TrueType fonts from the JRE
sun-java6-jdk – Contains the metapackage for the JDK
sun-java6-jre – Contains the metapackage for the JRE
sun-java6-plugin – Contains the plug-in for Mozilla-based browsers
sun-java6-source – Contains source files for the JDK

Here is a quick and dirty way to install Java in your Ubuntu desktop / server

Edit the sources list
$ sudo nano /etc/apt/sources.list
Insert the following lines at the end of the file

deb http://us.archive.ubuntu.com/ubuntu dapper main restricted
deb http://us.archive.ubuntu.com/ubuntu dapper universe multiverse

Save (Ctrl+O ) and Exit (Ctrl+X) the file.

Update apt
$ sudo apt-get update
Now in terminal run the command line
$ sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
Agree to the terms and java will install automatically.


Test that Java install is successful
Run command
$ java -version
You will get something 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)
________________________________________________________

For manually installing java, you may follow the instructions here
http://sites.google.com/site/easylinuxtipsproject/java#TOC-HOW-TO-FOR-32-BIT-UBUNTU
________________________________________________________

1 comment:

  1. For the installation of Java in ubuntu, use the following steps..
    # apt-cache search ^sun-java
    sun-java6-jdk - Sun Java(TM) Development Kit (JDK) 6
    sun-java6-jre - Sun Java(TM) Runtime Environment (JRE) 6 (architecture independent files)

    Finally, execute java -version and make sure Java is installed properly as shown below.
    # java -version
    java version "1.6.0_16"
    Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
    Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode)
    Verify the Java Installation

    ReplyDelete

Note: Only a member of this blog may post a comment.