#!/bin/sh #jinstall - Command line script to easily add new java directories to #'alternatives'. This sets the java as default, and you can switch your #default java with update-java-alternatives # #Copyright 2012 Bruce.Ingalls at gmail & Alin Andrei #GPL v3 Affero license at http://www.gnu.org/ #Downloads & discussion at http://www.webupd8.org/ #Tested on Ubuntu Oneiric; should require few changes for other modern Unix systems #Currently tested only with JDK, not JRE. # Not fully internationalized, including japanese man pages set -e VER='0.6alpha' case $(dpkg --print-architecture) in 'i386'|'i586'|'i686') arch=i386; dld=i586; SHA256SUM_TGZ="8062f34f69dd1f1991bff517df52da606c53f5fa0d6677ceb46df30e93b53a70" #must be modified for each release ;; 'amd64' ) arch=amd64; dld=x64; SHA256SUM_TGZ="c78200ce409367b296ec39be4427f020e2c585470c4eed01021feada576f027f" #must be modified for each release ;; * ) echo "Please report to author unsupported platform '`uname -m`'."; echo "Proceeding without web browser plugin support"; arch=''; esac ########Variables if [ ! $arch = "arm" ]; then JAVA_VERSION=8u151 #must be modified for each release jdk-8u5-linux-x64.tar.gz J_DIR=jdk1.8.0_151 #must be modified for each release FILENAME=jdk-${JAVA_VERSION}-linux-${dld}.tar.gz #PARTNER_URL=http://download.oracle.com/otn-pub/java/jdk/8u111-b14/$FILENAME #must be modified for each release for JAVA_VERSION_OLD2 in `seq 1 150`; do #must be modified for each release FILENAMES_OLD2="jdk-8u${JAVA_VERSION_OLD2}-linux-${dld}*.tar.gz $FILENAMES_OLD2" done fi J_INSTALL_DIR=/usr/lib/jvm/java-8-oracle . /usr/share/debconf/confmodule db_get oracle-java8-installer/local echo "$SHA256SUM_TGZ $RET/$FILENAME" \ | sha256sum -c > /dev/null 2>&1 \ || db_set oracle-java8-installer/local /var/cache/oracle-jdk8-installer db_get oracle-java8-installer/local echo "$SHA256SUM_TGZ $RET/$FILENAME" \ | sha256sum -c > /dev/null 2>&1 \ || db_set oracle-java8-installer/local /usr/lib/oracle-jdk8-installer-unpackdir db_get oracle-java8-installer/local echo "$SHA256SUM_TGZ $RET/$FILENAME" \ | sha256sum -c > /dev/null 2>&1 \ || db_reset oracle-java8-installer/local while true; do db_input medium oracle-java8-installer/local || true db_go db_get oracle-java8-installer/local if [ -d "$RET" -a -f "$RET"/$FILENAME ]; then LOCAL="true" break; elif [ "x$RET" = "x" ]; then break; fi db_reset oracle-java8-installer/not_exist || true db_reset oracle-java8-installer/local || true db_text medium oracle-java8-installer/not_exist || true db_go done exit 0