User:Jlo/java8

From Alpine Linux

on a data install

URL=http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/server-jre-8u131-linux-x64.tar.gz
JDK=jdk1-8.0_131
FILE=server-jre-8u131-linux-x64.tar.gz
cd /var
apk update
apk add ca-certificates curl paxctl
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.25-r0/glibc-2.25-r0.apk
apk add glibc-2.25-r0.apk
wget $URL
tar xzf $FILE
rm $FILE
ln -s $JDK java
echo 'export JAVA_HOME=/var/java' > /etc/profile.d/java.sh
echo 'export PATH=$JAVA_HOME/bin:$PATH' >> /etc/profile.d/java.sh
. /etc/profile.d/java.sh
paxctl -c /var/java/bin/java
paxctl -m /var/java/bin/java
paxctl -c /var/java/bin/javac
paxctl -m /var/java/bin/javac
java -version