Data Lake for Enterprises
上QQ阅读APP看书,第一时间看更新

Step 1 - Installing and verifying Java

  1. For the purpose of the examples covered in this book, it is recommended to go with Oracle JDK only.
  2. Please copy the download link to the latest Java JDK from the Oracle website. For Linux distributions, RPM download is recommended. At the time of writing this book, this is the Oracle JDK download page (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html), however this changes often, hence may require some fresh search and exploration on search engines.
  3. In order to download from the copied link, please run this command in CentOS shell. Here the copied link is the one pointing to the download.oracle.com, however since this link is dynamic, it will need to be copied for every download.
wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm
  1. Once downloaded, run the setup to complete the installation with the following commands:
  2. Install the downloaded RPM file by running the following command:
rpm --install <JDK_RPM_FILE>
  1. Set the JAVA_HOME environment variable, pointing to the directory where JDK is installed; usually it is in the subdirectories of /usr/java.
export JAVA_HOME=/usr/java/default
  1. Configure the PATH variable as:
export PATH=$PATH:$JAVA_HOME/bin
  1. Put the above export statements in ~/.bashrc
  2. Verify the install by executing the following command and observing that PATH has the location of JAVA folder installed:
echo $PATH

Even now, java -version would show Open JDK but that can be ignored as various components make use of JAVA_HOME as a reference point for JAVA install.