[root@name01 hadoop-2.3.0-cdh5.1.0]# java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) Client VM (build 25.20-b23, mixed mode)
[root@name01 hadoop-2.3.0-cdh5.1.0]# cd /usr/java
[root@name01 java]# ls
[root@name01 java]# echo $JAVA_HOME
/usr/local/jdk
[root@name01 java]# PWD
-bash: PWD: command not found
[root@name01 java]# pwd
/usr/java
[root@name01 java]# ls
[root@name01 java]# cd $JAVA_HOME
[root@name01 jdk]# pwd
/usr/local/jdk
[root@name01 jdk]# ls -l
total 25792
drwxr-xr-x 2 uucp 143 4096 Jul 30 2014 bin
-r--r--r-- 1 uucp 143 3244 Jul 30 2014 COPYRIGHT
drwxr-xr-x 4 uucp 143 4096 Jul 30 2014 db
drwxr-xr-x 3 uucp 143 4096 Jul 30 2014 include
-rw-r--r-- 1 uucp 143 5025525 Jul 25 2014 javafx-src.zip
drwxr-xr-x 5 uucp 143 4096 Jul 30 2014 jre
drwxr-xr-x 5 uucp 143 4096 Jul 30 2014 lib
-r--r--r-- 1 uucp 143 40 Jul 30 2014 LICENSE
drwxr-xr-x 4 uucp 143 4096 Jul 30 2014 man
-r--r--r-- 1 uucp 143 159 Jul 30 2014 README.html
-rw-r--r-- 1 uucp 143 524 Jul 30 2014 release
-rw-r--r-- 1 uucp 143 21053040 Jul 30 2014 src.zip
-rw-r--r-- 1 uucp 143 110114 Jul 25 2014 THIRDPARTYLICENSEREADME-JAVAFX.txt
-r--r--r-- 1 uucp 143 178400 Jul 30 2014 THIRDPARTYLICENSEREADME.txt
[root@name01 jdk]# cd ..
[root@name01 local]# ls -l
total 88
drwxr-xr-x. 2 root root 4096 Jun 12 20:38 bin
drwxr-xr-x 3 root root 4096 Jun 12 20:29 cmake
drwxr-xr-x 3 root root 4096 Jun 12 20:38 doc
drwxr-xr-x. 2 root root 4096 Sep 23 2011 etc
drwxr-xr-x. 2 root root 4096 Sep 23 2011 games
drwxr-xr-x 17 root root 4096 Jun 11 04:41 hadoop
drwxr-xr-x 3 root root 4096 Jun 12 21:49 hadoop_mvn
drwxr-xr-x 10 1106 592 4096 Jun 9 18:45 hive
drwxr-xr-x. 2 root root 4096 Sep 23 2011 include
drwxr-xr-x 8 uucp 143 4096 Jul 30 2014 jdk
drwxr-xr-x. 2 root root 4096 Sep 23 2011 lib
drwxr-xr-x. 2 root root 4096 Sep 23 2011 libexec
drwxrwxr-x 3 root root 4096 Jun 13 2015 __MACOSX
drwxr-xr-x 3 root root 4096 Jun 12 20:38 man
drwxr-xr-x 3 root root 4096 Jun 12 19:29 maven
drwxr-xr-x 3 root root 4096 Jun 12 19:43 protobuf
drwxr-xr-x. 2 root root 4096 Sep 23 2011 sbin
drwxr-xr-x. 7 root root 4096 Jun 12 20:38 share
drwxr-xr-x 4 root root 4096 Jun 10 20:05 spark
drwxr-xr-x 4 root root 4096 Jun 12 06:29 sqoop
drwxr-xr-x. 2 root root 4096 Jun 14 2015 src
drwxr-xr-x 3 root root 4096 Jun 12 17:44 zookeeper
[root@name01 local]# yum -install jdk-7u55-linux-x64.rpm
Loaded plugins: fastestmirror, refresh-packagekit, security
Usage: yum [options] COMMAND
List of Commands:
check Check for problems in the rpmdb
check-update Check for available package updates
clean Remove cached data
deplist List a package's dependencies
distribution-synchronization Synchronize installed packages to the latest available versions
downgrade downgrade a package
erase Remove a package or packages from your system
groupinfo Display details about a package group
groupinstall Install the packages in a group on your system
grouplist List available package groups
groupremove Remove the packages in a group from your system
help Display a helpful usage message
history Display, or use, the transaction history
info Display details about a package or group of packages
install Install a package or packages on your system
list List a package or groups of packages
load-transaction load a saved transaction from filename
makecache Generate the metadata cache
provides Find what package provides the given value
reinstall reinstall a package
repolist Display the configured software repositories
resolvedep Determine which package provides the given dependency
search Search package details for the given string
shell Run an interactive yum shell
update Update a package or packages on your system
update-minimal Works like update, but goes to the 'newest' package match which fixes a problem that affects your system
updateinfo Acts on repository update information
upgrade Update packages taking obsoletes into account
version Display a version for the machine and/or available repos.
Command line error: no such option: -i
[root@name01 local]# yum install jdk-7u55-linux-x64.rpm
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.yun-idc.com
* extras: mirrors.yun-idc.com
* updates: mirrors.yun-idc.com
Setting up Install Process
No package jdk-7u55-linux-x64.rpm available.
Error: Nothing to do
[root@name01 local]# yum install jdk-7u79-linux-i586.rpm
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.yun-idc.com
* extras: mirrors.yun-idc.com
* updates: mirrors.yun-idc.com
Setting up Install Process
No package jdk-7u79-linux-i586.rpm available.
Error: Nothing to do
[root@name01 local]# ls -l
\total 88
drwxr-xr-x. 2 root root 4096 Jun 12 20:38 bin
drwxr-xr-x 3 root root 4096 Jun 12 20:29 cmake
drwxr-xr-x 3 root root 4096 Jun 12 20:38 doc
drwxr-xr-x. 2 root root 4096 Sep 23 2011 etc
drwxr-xr-x. 2 root root 4096 Sep 23 2011 games
drwxr-xr-x 17 root root 4096 Jun 11 04:41 hadoop
drwxr-xr-x 3 root root 4096 Jun 12 21:49 hadoop_mvn
drwxr-xr-x 10 1106 592 4096 Jun 9 18:45 hive
drwxr-xr-x. 2 root root 4096 Sep 23 2011 include
drwxr-xr-x 8 uucp 143 4096 Jul 30 2014 jdk
drwxr-xr-x. 2 root root 4096 Sep 23 2011 lib
drwxr-xr-x. 2 root root 4096 Sep 23 2011 libexec
drwxrwxr-x 3 root root 4096 Jun 13 2015 __MACOSX
drwxr-xr-x 3 root root 4096 Jun 12 20:38 man
drwxr-xr-x 3 root root 4096 Jun 12 19:29 maven
drwxr-xr-x 3 root root 4096 Jun 12 19:43 protobuf
drwxr-xr-x. 2 root root 4096 Sep 23 2011 sbin
drwxr-xr-x. 7 root root 4096 Jun 12 20:38 share
drwxr-xr-x 4 root root 4096 Jun 10 20:05 spark
drwxr-xr-x 4 root root 4096 Jun 12 06:29 sqoop
drwxr-xr-x. 2 root root 4096 Jun 14 2015 src
drwxr-xr-x 3 root root 4096 Jun 12 17:44 zookeeper
[root@name01 local]# mkdir java
[root@name01 local]# ls -l
total 92
drwxr-xr-x. 2 root root 4096 Jun 12 20:38 bin
drwxr-xr-x 3 root root 4096 Jun 12 20:29 cmake
drwxr-xr-x 3 root root 4096 Jun 12 20:38 doc
drwxr-xr-x. 2 root root 4096 Sep 23 2011 etc
drwxr-xr-x. 2 root root 4096 Sep 23 2011 games
drwxr-xr-x 17 root root 4096 Jun 11 04:41 hadoop
drwxr-xr-x 3 root root 4096 Jun 12 21:49 hadoop_mvn
drwxr-xr-x 10 1106 592 4096 Jun 9 18:45 hive
drwxr-xr-x. 2 root root 4096 Sep 23 2011 include
drwxr-xr-x 2 root root 4096 Jun 12 22:57 java
drwxr-xr-x 8 uucp 143 4096 Jul 30 2014 jdk
drwxr-xr-x. 2 root root 4096 Sep 23 2011 lib
drwxr-xr-x. 2 root root 4096 Sep 23 2011 libexec
drwxrwxr-x 3 root root 4096 Jun 13 2015 __MACOSX
drwxr-xr-x 3 root root 4096 Jun 12 20:38 man
drwxr-xr-x 3 root root 4096 Jun 12 19:29 maven
drwxr-xr-x 3 root root 4096 Jun 12 19:43 protobuf
drwxr-xr-x. 2 root root 4096 Sep 23 2011 sbin
drwxr-xr-x. 7 root root 4096 Jun 12 20:38 share
drwxr-xr-x 4 root root 4096 Jun 10 20:05 spark
drwxr-xr-x 4 root root 4096 Jun 12 06:29 sqoop
drwxr-xr-x. 2 root root 4096 Jun 14 2015 src
drwxr-xr-x 3 root root 4096 Jun 12 17:44 zookeeper
[root@name01 local]# cd j
-bash: cd: j: No such file or directory
[root@name01 local]# cd java/
[root@name01 java]# ls -l
total 0
[root@name01 java]# pwd
/usr/local/java
[root@name01 java]# cp /mnt/hgfs/hadoop_sty/hive/zk/jdk-7u79-linux-i586.rpm
cp: missing destination file operand after `/mnt/hgfs/hadoop_sty/hive/zk/jdk-7u79-linux-i586.rpm'
Try `cp --help' for more information.
[root@name01 java]# cp /mnt/hgfs/hadoop_sty/hive/zk/jdk-7u79-linux-i586.rpm .
[root@name01 java]#
[root@name01 java]# ls -l
total 133532
-rwxr-xr-x 1 root root 136735192 Jun 12 22:58 jdk-7u79-linux-i586.rpm
[root@name01 java]# yum install jdk-7u79-linux-i586.rpm
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.yun-idc.com
* extras: mirrors.yun-idc.com
* updates: mirrors.yun-idc.com
Setting up Install Process
Examining jdk-7u79-linux-i586.rpm: 2000:jdk-1.7.0_79-fcs.i586
Marking jdk-7u79-linux-i586.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package jdk.i586 2000:1.7.0_79-fcs will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================================================================================================
Package Arch Version Repository Size
====================================================================================================================================================================================
Installing:
jdk i586 2000:1.7.0_79-fcs /jdk-7u79-linux-i586 206 M
Transaction Summary
====================================================================================================================================================================================
Install 1 Package(s)
Total size: 206 M
Installed size: 206 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Check Error:
installing package jdk-2000:1.7.0_79-fcs.i586 needs 222MB on the / filesystem
Error Summary
-------------
Disk Requirements:
At least 222MB more space needed on the / filesystem.
[root@name01 java]# ls -l
total 133532
-rwxr-xr-x 1 root root 136735192 Jun 12 22:58 jdk-7u79-linux-i586.rpm
[root@name01 java]# yum install /mnt/hgfs/hadoop_sty/hive/zk/jdk-7u79-linux-i586.rpm
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.yun-idc.com
* extras: mirrors.yun-idc.com
* updates: mirrors.yun-idc.com
Setting up Install Process
Examining /mnt/hgfs/hadoop_sty/hive/zk/jdk-7u79-linux-i586.rpm: 2000:jdk-1.7.0_79-fcs.i586
Marking /mnt/hgfs/hadoop_sty/hive/zk/jdk-7u79-linux-i586.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package jdk.i586 2000:1.7.0_79-fcs will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================================================================================================
Package Arch Version Repository Size
====================================================================================================================================================================================
Installing:
jdk i586 2000:1.7.0_79-fcs /jdk-7u79-linux-i586 206 M
Transaction Summary
====================================================================================================================================================================================
Install 1 Package(s)
Total size: 206 M
Installed size: 206 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Check Error:
installing package jdk-2000:1.7.0_79-fcs.i586 needs 82MB on the / filesystem
Error Summary
-------------
Disk Requirements:
At least 82MB more space needed on the / filesystem.
[root@name01 java]# ls
jdk-7u79-linux-i586.rpm
[root@name01 java]# rm -rf *
[root@name01 java]# ls
[root@name01 java]# yum install /mnt/hgfs/hadoop_sty/hive/zk/jdk-7u79-linux-i586.rpm
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.yun-idc.com
* extras: mirrors.yun-idc.com
* updates: mirrors.yun-idc.com
Setting up Install Process
Examining /mnt/hgfs/hadoop_sty/hive/zk/jdk-7u79-linux-i586.rpm: 2000:jdk-1.7.0_79-fcs.i586
Marking /mnt/hgfs/hadoop_sty/hive/zk/jdk-7u79-linux-i586.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package jdk.i586 2000:1.7.0_79-fcs will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================================================================================================
Package Arch Version Repository Size
====================================================================================================================================================================================
Installing:
jdk i586 2000:1.7.0_79-fcs /jdk-7u79-linux-i586 206 M
Transaction Summary
====================================================================================================================================================================================
Install 1 Package(s)
Total size: 206 M
Installed size: 206 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 2000:jdk-1.7.0_79-fcs.i586 1/1
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
jfxrt.jar...
plugin.jar...
javaws.jar...
deploy.jar...
Verifying : 2000:jdk-1.7.0_79-fcs.i586 1/1
Installed:
jdk.i586 2000:1.7.0_79-fcs
Complete!
[root@name01 java]#
[root@name01 local]# mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /usr/local/maven/apache-maven-3.3.9
Java version: 1.8.0_20, vendor: Oracle Corporation
Java home: /usr/local/jdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-358.el6.i686", arch: "i386", family: "unix"
[root@name01 local]# java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) Client VM (build 25.20-b23, mixed mode)
[root@name01 local]# cd cd /usr/java
bash: cd: cd: No such file or directory
[root@name01 local]# cd /usr/java
[root@name01 java]# ls -l
total 4
lrwxrwxrwx 1 root root 16 Jun 12 23:02 default -> /usr/java/latest
drwxr-xr-x 8 root root 4096 Jun 12 23:02 jdk1.7.0_79
lrwxrwxrwx 1 root root 21 Jun 12 23:02 latest -> /usr/java/jdk1.7.0_79
[root@name01 java]# pwd
/usr/java
[root@name01 java]# cd ..
[root@name01 usr]# ls -l
total 140
dr-xr-xr-x. 2 root root 36864 Jun 12 23:02 bin
drwxr-xr-x. 2 root root 4096 Sep 23 2011 etc
drwxr-xr-x. 2 root root 4096 Sep 23 2011 games
drwxr-xr-x. 41 root root 4096 Jun 12 20:43 include
drwxr-xr-x 3 root root 4096 Jun 12 23:02 java
dr-xr-xr-x. 96 root root 45056 Jun 12 20:44 lib
drwxr-xr-x. 22 root root 12288 Jun 12 19:54 libexec
drwxr-xr-x. 25 root root 4096 Jun 12 22:57 local
dr-xr-xr-x. 2 root root 12288 Jun 12 20:43 sbin
drwxr-xr-x. 164 root root 4096 Jun 12 23:03 share
drwxr-xr-x. 4 root root 4096 Sep 9 2013 src
lrwxrwxrwx. 1 root root 10 Sep 9 2013 tmp -> ../var/tmp
[root@name01 usr]# date
Sun Jun 12 23:08:41 PDT 2016
[root@name01 usr]# cd java/
[root@name01 java]# ls -l
total 4
lrwxrwxrwx 1 root root 16 Jun 12 23:02 default -> /usr/java/latest
drwxr-xr-x 8 root root 4096 Jun 12 23:02 jdk1.7.0_79
lrwxrwxrwx 1 root root 21 Jun 12 23:02 latest -> /usr/java/jdk1.7.0_79
[root@name01 java]# cd jdk1.7.0_79/
[root@name01 jdk1.7.0_79]# pwd
/usr/java/jdk1.7.0_79
[root@name01 jdk1.7.0_79]# ls -l
total 19796
drwxr-xr-x 2 root root 4096 Jun 12 23:01 bin
-rw-r--r-- 1 root root 3339 Apr 10 2015 COPYRIGHT
drwxr-xr-x 4 root root 4096 Jun 12 23:01 db
drwxr-xr-x 3 root root 4096 Jun 12 23:01 include
drwxr-xr-x 5 root root 4096 Jun 12 23:01 jre
drwxr-xr-x 5 root root 4096 Jun 12 23:02 lib
-rw-r--r-- 1 root root 40 Apr 10 2015 LICENSE
drwxr-xr-x 4 root root 4096 Jun 12 23:02 man
-rw-r--r-- 1 root root 114 Apr 10 2015 README.html
-rw-r--r-- 1 root root 498 Apr 10 2015 release
-rw-r--r-- 1 root root 19941465 Apr 10 2015 src.zip
-rw-r--r-- 1 root root 110114 Mar 16 2015 THIRDPARTYLICENSEREADME-JAVAFX.txt
-rw-r--r-- 1 root root 173571 Apr 10 2015 THIRDPARTYLICENSEREADME.txt
[root@name01 jdk1.7.0_79]# echo $JAVA_HOME
/usr/local/jdk
[root@name01 jdk1.7.0_79]#
[root@name01 local]# java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) Client VM (build 25.20-b23, mixed mode)
[root@name01 local]# PWD
-bash: PWD: command not found
[root@name01 local]# pwd
/usr/local
[root@name01 local]# cd jdk/
[root@name01 jdk]# ls -l
total 25792
drwxr-xr-x 2 uucp 143 4096 Jul 30 2014 bin
-r--r--r-- 1 uucp 143 3244 Jul 30 2014 COPYRIGHT
drwxr-xr-x 4 uucp 143 4096 Jul 30 2014 db
drwxr-xr-x 3 uucp 143 4096 Jul 30 2014 include
-rw-r--r-- 1 uucp 143 5025525 Jul 25 2014 javafx-src.zip
drwxr-xr-x 5 uucp 143 4096 Jul 30 2014 jre
drwxr-xr-x 5 uucp 143 4096 Jul 30 2014 lib
-r--r--r-- 1 uucp 143 40 Jul 30 2014 LICENSE
drwxr-xr-x 4 uucp 143 4096 Jul 30 2014 man
-r--r--r-- 1 uucp 143 159 Jul 30 2014 README.html
-rw-r--r-- 1 uucp 143 524 Jul 30 2014 release
-rw-r--r-- 1 uucp 143 21053040 Jul 30 2014 src.zip
-rw-r--r-- 1 uucp 143 110114 Jul 25 2014 THIRDPARTYLICENSEREADME-JAVAFX.txt
-r--r--r-- 1 uucp 143 178400 Jul 30 2014 THIRDPARTYLICENSEREADME.txt
[root@name01 jdk]# vi /etc/profile
[root@name01 jdk]# source /etc/profile
[root@name01 jdk]# java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) Client VM (build 24.79-b02, mixed mode, sharing)
[root@name01 jdk]# source /etc/profile
[root@name01 jdk]# echo $JAVA_HOME
/usr/java/jdk1.7.0_79
[root@name01 jdk]#