Saturday, April 14, 2012

How to install Java / OpenJDK in Ubuntu

About how to install Java / OpenJDK in different versions and releases of Ubuntu (>= 10.04.4).

To install R, JGR and Deducer in Ubuntu you will need Java - a technology from Oracle (formerly: Sun Microsystems). There are several implementations, of which the free OpenJDK Development Kit (JDK) is the easiest to install and the default version of Java that Ubuntu uses.
  • Installation of OpenJDK
For Ubuntu 10.04.4, 10.10 and 11.04 (32/64-bit) on the official repositories only the 6th version of OpenJDK is available. To install it just run in terminal (with root privileges):
apt-get install -y openjdk-6-jdk

If you have installed other versions of Java, set OpenJDK as default:
update-java-alternatives -s java-6-openjdk

If R is already installed, enable Java support:
R CMD javareconf

For Ubuntu 11.10 and 12.04 (32/64-bit) on the official repositories are available both 6th and 7th versions of OpenJDK. To install one of them just run in terminal (with root privileges):
apt-get install -y openjdk-6-jdk
or
apt-get install -y openjdk-7-jdk

If you have installed also other versions of Java, set OpenJDK as default -
for the 6th version, 32/64-bit:
update-java-alternatives -s java-1.6.0-openjdk
for the 7th version, 32-bit:
update-java-alternatives -s java-1.7.0-openjdk-i386
for the 7th version, 64-bit:
update-java-alternatives -s java-1.7.0-openjdk-amd64

To solve received errors, please, read the post Solving OpenJDK install errors in Ubuntu.

0 comments:

Post a Comment