steps to upgrade jdk-8 & gradle-2.11

Upgrading java using update-alternatives


  1. Download the latest java-8 binary zip from official oracle downloads
  2. Create a new folder  under /opt
     mkdir -p /opt/jdk-8
  3. Extract the gzip file to the /opt/jdk-8 directory
     tar -zxf jdk-8u5-linux-x64.tar.gz -C /opt/jdk-8
  4. Setting Oracle JDK as the default JVM
    update-alternatives --install /usr/bin/java java  /opt/jdk-8/jdk1.8.0_74/bin/java 2000
    update-alternatives --install /usr/bin/javac  javac /opt/jdk-8/jdk1.8.0_74/bin/javac 2000
  5. Configure java if more than one java version is available already.
     update-alternatives --config java

    choose the correct number if prompted .

  6.  Verify the installation
     java –version

Upgrading gradle manually.


  1. Download the latest gradle binary file from gradle-2.11-all.zip
  2. Create a new folder  under /opt
     mkdir -p /opt/gradle-2.11
  3. Extract the gzip file to the /opt/gradle-2.11 directory
     tar -zxf gradle-2.11.all.zip -C /opt/gradle-2.11
  4. Create a symbolic link to the original file.
     ln -s /opt/gradle-2.11/bin/gradle /usr/local/bin/gradle
  5. Verify the installation
     gradle –version

Note:
gradle –version -> may still use the older version of java  if  JAVA_HOME is not  points to the latest jdk-8 directory.

 export JAVA_HOME=/opt/jdk-8/jdk1.8.0_74
 export PATH=$PATH:$JAVA_HOME/bin

reference:
https://www.digitalocean.com/community/tutorials/how-to-manually-install-oracle-java-on-a-debian-or-ubuntu-vps

Advertisements