http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
(In my case, the select file was jdk-8u5-linux-i586.tar.gz because my Fedora is 32 bits).
02) As root user, create directory /usr/java and move the file to this new directory.
[root@thanatos java]# pwd
/usr/java
[root@thanatos java]# ls -lrt
total 156164
-rw-r--r--. 1 root root 159910666 Jun 19 19:58 jdk-8u5-linux-i586.gz
[root@thanatos java]#
03) Uncompress the file.
[root@thanatos java]# gunzip jdk-8u5-linux-i586.gz
[root@thanatos java]# ls -lrt
total 321008
-rw-r--r--. 1 root root 328704000 Jun 19 19:58 jdk-8u5-linux-i586
[root@thanatos java]#
04) Due to a lack in Oracle site, uncompressed file does not have .tar extension. No problem, untar it using "tar -xvf". Since I have obsessive compulsive disorder, I changed the file name to put the extension .tar before untaring it.
[root@thanatos java]# mv jdk-8u5-linux-i586 jdk-8u5-linux-i586.tar
[root@thanatos java]# tar -xvf jdk-8u5-linux-i586.tar
jdk1.8.0_05/
jdk1.8.0_05/src.zip
jdk1.8.0_05/lib/
jdk1.8.0_05/lib/ir.idl
... supressed lines ...
jdk1.8.0_05/db/bin/setNetworkServerCP.bat
jdk1.8.0_05/db/bin/stopNetworkServer.bat
jdk1.8.0_05/db/README-JDK.html
[root@thanatos java]#
05) In order to save disk space, remove tar file.
[root@thanatos java]# ls -lart
total 321012
drwxr-xr-x. 8 10 143 4096 Mar 18 05:03 jdk1.8.0_05
-rw-r--r--. 1 root root 328704000 Jun 19 19:58 jdk-8u5-linux-i586.tar
drwxr-xr-x. 12 root root 4096 Jun 19 19:59 ..
drwxr-xr-x. 3 root root 4096 Jun 19 20:04 .
[root@thanatos java]# rm jdk-8u5-linux-i586.tar
rm: remove regular file ‘jdk-8u5-linux-i586.tar’? y
[root@thanatos java]#
06) Edit /etc/profile in order to set the new java directory for all users, by including these lines at the file:
[root@thanatos bin]# vi /etc/profile
#Line to be added (please, correct for newest versions of Java).
export JAVA_HOME=/usr/java/jdk1.8.0_05
export PATH=$JAVA_HOME/bin:$PATH
07) To be continued...
I know that there is an issue about running java classes from crontab, because .profile is not read.
No comments:
Post a Comment