Thursday, 10 June 2010

How To Install Java (JRE) in Ubuntu Linux

Java is an object-oriented programming language developed by Sun.  Java is used by a large number of websites and you will likely require it for an optimal web browsing experience.  Ubuntu doesn't come with Java, but it is incredibly easy to install (note: make sure you have previously enabled the multiverse repository).

A quick search for "sun-java" in Synaptic Package Manager results in the following main packages:

  • sun-java6-bin
  • sun-java6-demo
  • sun-java6-fonts
  • sun-java6-javadb
  • sun-java6-jdk
  • sun-java6-jre
  • sun-java6-plugin
  • sun-java6-source
 If you only require java for your internet experience (99% of users), you only require sun-java6-fontssun-java6-jre, and sun-java6-plugin.  Mark the packages for installation via Synaptic Package Manager or install via terminal:

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

After going through the install prompts, you may verify the install via terminal with the command:

java -version

You should see output that looks something like this:

java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)

Lastly, you can check that java is working in your favourite internet browser by visiting this test page.  You have now successfully installed java in Ubuntu!


Anonymous said...

Thank You!!!!
To those new to Linux development, just getting the environment setup (in my case uBuntu 10.4 + resin) getting past the Java install was (sadly) a big problem :(

  © Blogger template 'Isolation' by 2008

Back to TOP