How to Install Java Runtime Environment (JRE) in Ubuntu



Java is an object-oriented programming language developed by Sun Microsystems in the early 1990s. Java applications are compiled to bytecode, which at runtime is either interpreted or compiled to native machine code for execution.


The language itself derives much of its syntax from C and C++ but has a simpler object model and fewer low-levelfacilities. JavaScript, a scripting language, shares a similar name and has similar syntax, but is not directly related to Java.

Currently Ubuntu has the following Java packages

sun-java5-bin - Contains the binaries

sun-java5-demo - Contains demos and examples

sun-java5-doc - Contains the documentation

sun-java5-fonts - Contains the Lucida TrueType fonts from the JRE

sun-java5-jdk - Contains the metapackage for the JDK

sun-java5-jre - Contains the metapackage for the JRE

sun-java5-plugin - Contains the plug-in for Mozilla-based browsers

sun-java5-source - Contains source files for the JDK

Installing the Java Runtime Environment

First you need to check multiverse repository enabled or not after that open a terminal window. Since you are going to be installing the JRE and the web browser plug-in, you'll be using the following command from a terminal

sudo apt-get install sun-java5-jre sun-java5-plugin sun-java5-fonts

Once it downloads the packages and begins the installation, you'll get a screen that contains the Sun Operating System Distributor License for Java and hit Enter to continue. You'll see a dialog that asks you if you agree with the DLJ license terms. Select Yes, and hit Enter; the JRE will finish installing.

Testing Java Runtime Environment

You'll want to confirm that your system is configured properly for Sun's JRE. This is a two-step process.

First, check that the JRE is properly installed by running the following command from a terminal.

java -version

You should get similar output

java version "1.5.0_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b03)
Java HotSpot(TM) Client VM (build 1.5.0_08-b03, mixed mode, sharing)

Testing Java Plugin for Firefox

open Firefox and typing about:plugins in the address bar and check for java plugin





0 comments: