Saturday, 21 May 2011

Install Java

Uninstall OpenJDK or other JDKs you might have
Unless you need to have more JDKs (or you believe you do), please remove them now.
If the command java returns something decent than you have something already installed.

Go to: and choose your preferred version (i586 / x64).
When I was writing this post, the latest version was 6u25.
(Java version names are really stupid, normally this would be called
I chose the x64 version :)

You will download a file with a very long name.
You don’t really need to know it.
Just type “mv jdk” and then <tab> and then continue with “ /opt jdk-6u25-linux-x64.bin”.
You will get something like:
mv jdk-6u25-linux-x64.bin?longUselessStory /opt/jdk-6u25-linux-x64.bin

mkdir /usr/java
cd /usr/java
sh /opt/jdk-6u25-linux-x64.bin

Edit /root/bash_profile (vi, Midnight Commander editor, whatever) 
export JAVA_HOME
export PATH

Test Java
 java -version
You should get something that includes "Java(TM) SE Runtime Environment (build 1.6.0_25-b06)"

No comments:

Post a Comment