Christophe Casalegno

The Perfect Automatic Java Installer for Debian 8

Hi all, today I’ll give you a simple way to quickly install Oracle Java 8 on your Debian 8 server with just one command. In the future I’ll add parameters so in the future it will be possible to choose your java version and the default version you want to be active on the system.

Now stop to talk, just take a look on the script :


#!/bin/sh
#
# PAJI : The Perfect Automatic Java Installer
# Version : 0.1
# Author : Christophe Casalegno aka Brain 0verride
# Website : https://www.christophe-casalegno.com
# Twitter : https://twitter.com/Brain0verride
#
# Note : Just for Oracle Java 8 for the moment, i'll add more after
# Note 2 : Only tested on Debian 8

source_1="deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
source_2="deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
source_list="/etc/apt/sources.list.d/webupd8team-java.list"
keyserver="hkp://keyserver.ubuntu.com:80"
key="EEA14886"
packages="oracle-java8-installer oracle-java8-set-default"

echo "$source_1" | tee $source_list
echo "$source_2" | tee -a $source_list

apt-key adv --keyserver $keyserver --recv-keys $key
apt-get update
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
apt-get -y -f install $packages

exit 0

Note : when you’ll download PAJI, it will be probably different because i’ll add it some features. I’ll create a specific page for it like for PALI, my Perfect Automatic LAMP Installer

So for automatically install Oracle Java8 for Debian 8 just do it :


wget --no-check-certificate https://www.christophe-casalegno.com/tools/paji.sh
chmod +x paji.sh
./paji.sh

 
That all, no need to ask question about license or other thing : PAJI do it for you. You can also download the script : PAJI

Last version & note will be available from here : PAJI

Enjoy !


Christophe Casalegno

Leave a Comment