#!/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=x86; SHA256SUM_TGZ="257a833b4757d7e29491b5f838684935d44b02c3a7d09351d31a80b4bd1066c4" #must be modified for each release ;; 'amd64' ) arch=amd64; dld=x64; SHA256SUM_TGZ="d937146a992d3689cddb1975956da2d50a16ea16d80f87bf20477f4a64aa31d1" #must be modified for each release ;; arm* ) arch=arm if [ `uname -m` = "armv7l" ] || [ `uname -m` = "armv6l" ]; then if [ -x /usr/bin/readelf ] ; then HARDFLOAT=`readelf -A /proc/self/exe | grep Tag_ABI_VFP_args` if [ -z "$HARDFLOAT" ]; then # Softfloat #dld='arm32-sflt' #SHA256SUM_TGZ="d7a6296bd0cf95cd70a53d4bd2475f7910aadf9e04167979224e7004f919d95f" #must be modified for each release echo "Oracle JDK9 only supports ARM v6/v7 hardfloat and ARM64." arch='' else # Hardfloat dld='arm32-vfp-hflt' SHA256SUM_TGZ="53f7d591090f4e978370797e4e94ab8b4946b2bb385f8e25752fb7735490a941" #must be modified for each release fi fi elif [ `uname -m` = "armv8l" ] || [ `uname -m` = "arm64" ] || [ `uname -m` = "aarch64" ]; then dld='arm64-vfp-hflt' SHA256SUM_TGZ="cf62334c5f862bb0dd9bed53da8cc6a5460cc8566ef192b7445670d6594061ac" #must be modified for each release else echo "Oracle JDK9 only supports ARM v6/v7 hardfloat and ARM64." arch='' fi ;; * ) echo "Please report to author unsupported platform '`uname -m`'."; echo "Proceeding without web browser plugin support"; arch=''; esac ########Variables if [ ! $arch = "arm" ]; then if [ ! $arch = "amd64" ]; then JAVA_VERSION_MAJOR=9 # JAVA_VERSION_MINOR=140 #must be modified for each release JAVA_VERSION_DATE="04_nov_2015" #no longer needed with b95 J_DIR=jdk-9 #must be modified for each release FILENAME=jdk-${JAVA_VERSION_MAJOR}-ea+${JAVA_VERSION_MINOR}_linux-${dld}_bin.tar.gz # dk-9-ea+109_linux-x86_bin.tar.gz else JAVA_VERSION_MAJOR=9.0.1 # JAVA_VERSION_MINOR=11 #must be modified for each release #JAVA_VERSION_DATE="dic_2017" #no longer needed with b95 J_DIR=jdk-${JAVA_VERSION_MAJOR} #must be modified for each release FILENAME=jdk-9-linux-x64.tar.gz # dk-9-ea+109_linux-x86_bin.tar.gz fi PARTNER_URL=http://www.java.net/download/java/jdk${JAVA_VERSION_MAJOR}/archive/${JAVA_VERSION_MINOR}/binaries/$FILENAME else JAVA_VERSION_MAJOR=9 # JAVA_VERSION_MINOR=140 #must be modified for each release JAVA_VERSION_DATE="04_nov_2015" #no longer needed with b95 J_DIR=jdk-9 #must be modified for each release FILENAME=jdk-${JAVA_VERSION_MAJOR}-ea+${JAVA_VERSION_MINOR}_linux-${dld}_bin.tar.gz # jdk-9-ea+109_linux-arm64-vfp-hflt_bin.tar.gz PARTNER_URL=http://www.java.net/download/java/jdk${JAVA_VERSION_MAJOR}/archive/${JAVA_VERSION_MINOR}/binaries/$FILENAME fi for JAVA_VERSION_OLD1 in `seq 48 139`; do #must be modified for each release FILENAMES_OLD1="jdk-${JAVA_VERSION_MAJOR}-ea-bin-b${JAVA_VERSION_OLD1}-linux*.tar.gz $FILENAMES_OLD1" done for JAVA_VERSION_OLD2 in `seq 48 139`; do #must be modified for each release FILENAMES_OLD2="jdk-${JAVA_VERSION_MAJOR}-ea+${JAVA_VERSION_OLD2}_linux*.tar.gz $FILENAMES_OLD2" done J_INSTALL_DIR=/usr/lib/jvm/java-9-oracle . /usr/share/debconf/confmodule db_get oracle-java9-installer/local echo "$SHA256SUM_TGZ $RET/$FILENAME" \ | sha256sum -c > /dev/null 2>&1 \ || db_set oracle-java9-installer/local /var/cache/oracle-jdk9-installer db_get oracle-java9-installer/local echo "$SHA256SUM_TGZ $RET/$FILENAME" \ | sha256sum -c > /dev/null 2>&1 \ || db_set oracle-java9-installer/local /usr/lib/oracle-jdk9-installer-unpackdir db_get oracle-java9-installer/local echo "$SHA256SUM_TGZ $RET/$FILENAME" \ | sha256sum -c > /dev/null 2>&1 \ || db_reset oracle-java9-installer/local while true; do db_input medium oracle-java9-installer/local || true db_go db_get oracle-java9-installer/local if [ -d "$RET" -a -f "$RET"/$FILENAME ]; then LOCAL="true" break; elif [ "x$RET" = "x" ]; then break; fi db_reset oracle-java9-installer/not_exist || true db_reset oracle-java9-installer/local || true db_text medium oracle-java9-installer/not_exist || true db_go done exit 0