Installing oracle jdk on ubuntu
Ubuntu boxes have by default open-jdk wich is a great tool, some tools requires oracle jdk version in order to run properly, ie CassandraDB this post shows how to install oracle jdk on ubuntu systems
Checking the current java version installed
$ java --version java version "1.5.0" gij (GNU libgcj) version 4.6.3 Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Download and Installing oracle jdk
- Create a directory on your local filesystem where the jdk will live
$sudo mkdir -p /opt/oracle/jdk
- Visit Oracle website choose jdk that suit your needs and dowload it download the file with the .bin extension
- Change permission and execute downloaded file under /opt/oracle/jdk directory
Make symbolyc links between oracle jdk executables and /etc/alternatives directory.
$sudo ln -s /opt/oracle/jdk/jdk1.6.0_45/bin/java /etc/alternatives/javaoracle
$sudo ln -s /opt/oracle/jdk/jdk1.6.0_45/bin/javac /etc/alternatives/javacoracle
alias java=/etc/alternatives/javaoracleNow you can check again your java version:
$java -version java version "1.6.0_45" Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)