- Data Lake for Enterprises
- Tomcy John Pankaj Misra
- 235字
- 2021-07-02 22:47:16
Step 1 - Installing and verifying Java
- For the purpose of the examples covered in this book, it is recommended to go with Oracle JDK only.
- 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.
- 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
- Once downloaded, run the setup to complete the installation with the following commands:
- Install the downloaded RPM file by running the following command:
rpm --install <JDK_RPM_FILE>
- 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
- Configure the PATH variable as:
export PATH=$PATH:$JAVA_HOME/bin
- Put the above export statements in ~/.bashrc
- 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.