# Oracle Java #
##### upgrade/remove
## To upgrade remove all previous and do install steps for the new version (with install steps)

# Check installed
update-alternatives --display java

# Remove all java
update-alternatives --remove-all java

## Same for javac
# Check installed
update-alternatives --display javac

# Remove all java
update-alternatives --remove-all javac

# Delete old java files
rm -r /opt/java-jdk/*

##### install
# Download from offical site please ! 
# Download linux x64 with .tar.gz from here http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
tar -C /opt/java-jdk -zxf jdk-*-linux-x64.tar.gz && rm jdk-*-linux-x64.tar.gz

## Next use update-alternatives command to make it default on your Debian stretch system:
update-alternatives --install /usr/bin/java java /opt/java-jdk/jdk*/bin/java 1
update-alternatives --install /usr/bin/javac javac /opt/java-jdk/jdk*/bin/javac 1

### Confirm Install

# The Oracle SE Development Kit should now be default on your system. To confirm, query java's version:
java -version

##output (example):
#java version "1.8.0_131"
#Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
#Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
