#!/bin/bash

set -e

mkdir -p /opt/techs

VERSION=$1
HASH=$2
NUM=$3

cd /usr/src

wget https://download.java.net/java/GA/jdk${VERSION}/${HASH}/${NUM}/GPL/openjdk-${VERSION}_linux-x64_bin.tar.gz
tar xf openjdk-${VERSION}_linux-x64_bin.tar.gz
mv jdk-${VERSION} /opt/techs/openjdk-$VERSION
rm openjdk-${VERSION}_linux-x64_bin.tar.gz
