Download and Install of Java (JRE) on Centos

  • Published on Aug 16 2007
  • # 6,548
  • *nix

Here’s how I installed JDK on Centos (thanks to http://www.trading-shim.org/faq/?java)

Download

Go to http://java.sun.com/javase/downloads/index.jsp and download the desired file.

Extract the .bin file

[root@localhost tmp]# chmod 755 j2re-1_4_2_15-linux-i586-rpm.bin
[root@localhost tmp]# ./j2re-1_4_2_15-linux-i586-rpm.bin

Install the .rpm file

[root@localhost tmp]# rpm -Uvh j2re-1_4_2_15-linux-i586.rpm
Preparing...                ########################################### [100%]
   1:j2re                   ########################################### [100%]


Adjust environment

Finally add the path to the java executable in the /etc/profile file.

Test

$ java -version
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)

View symbolic links

In my environment a symbolic link is created in /usr/bin/java which points to /usr/java/default/bin/java.

$ which java
/usr/bin/java
$ ls -la /usr/bin/java
lrwxrwxrwx 1 root root 26 Jul 31 14:38 /usr/bin/java -> /usr/java/[strong]default[/strong]/bin/java
$ ls -la /usr/java/
total 40
drwxr-xr-x  4 root root 4096 Jul 31 14:38 .
drwxr-xr-x 14 root root 4096 Jun 14 21:03 ..
lrwxrwxrwx  1 root root   16 Jul 31 14:38 [strong]default[/strong] -> /usr/java/[strong]latest[/strong]
drwxr-xr-x  7 root root 4096 Jul 31 14:16 j2re1.4.2_15
drwxr-xr-x  9 root root 4096 Jul 31 14:38 jdk1.6.0_02
lrwxrwxrwx  1 root root   21 Jul 31 14:38 [strong]latest[/strong] -> /usr/java/jdk1.6.0_02
$

One thought on “Download and Install of Java (JRE) on Centos

  1. Stan says:

    This was extremely helpful. Thanks!

Leave a Reply

Helpful? - leave your note below so I can brag

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>