Introduction
This page is based on experience of setting up Java 8 on Ubuntu 14.04. Much of it may be applicable to other Java versions and distros.
Architecture
First we check which architecture we are running on.
Open a terminal and type the command :
arch
The output could be i686 or i386 for a 32 bits system or x86_64 for a 64 bits system.
Environment
On Ubuntu 14.04 and for historical reasons the Java commands are under the /usr/bin directory.
However in order to manage multiple version of Java the update-alternatives mechanism has been introduced. It allows multiple "providers" to be installed on the same machine, and configures which is the default.
This mechanism consists of two directories, /etc/alternatives who contains the symlinks and /var/lib/dpkg/alternatives who contains update-alternatives state information.
Let's see the java command:
xavier@blueberry:/usr/bin$ ls -al /usr/bin/java
lrwxrwxrwx 1 root root 22 Mar 12 2013 /usr/bin/java -> /etc/alternatives/java