Learning Continuous Integration with Jenkins(Second Edition)
上QQ阅读APP看书,第一时间看更新

Installing Java

Follow these steps to install Java:

  1. Move to the /tmp directory and download Java:
        cd /tmp 
wget -O java_8.131.rpm \
http://javadl.oracle.com/webapps/download/AutoDL? \
BundleId=220304_d54c1d3a095b4ff2b6607d096fa80163
  1. Next, install Java. The following command will install the JRE:
        sudo rpm -ivh java_8.131.rpm 
  1. To set the JAVA_HOME environment variable, first get the Java installation's location. Do this by executing the following command:
        sudo alternatives --config java       
  1. The previous command will print the list of Java applications installed on your machine, along with their installation paths. Copy the Java path that appears on your Terminal:
        There is 1 program that provides 'java'. 
        Selection    Command 
        ----------------------------------------------- 
        *+ 1           /usr/java/jre1.8.0_131/bin/java
  1. Add the Java path (the one that you copied earlier) inside the /etc/environment file using the following command:
        sudo sh \
-c "echo JAVA_HOME=/usr/java/jre1.8.0_131 >>
/etc/environment"