Another alternative is using SDKMAN! See https://wimdeblauwe.wordpress.com/2018/09/26/switching-between-jdk-8-and-11-using-sdkman/
First install SDKMAN: https://sdkman.io/install and then...
sdk install java 8.0.181-oracle
sdk install java 11.0.0-open
To switch:
sdk use java 8.0.181-oracle
sdk use java 11.0.0-open
To set a default:
sdk default java 8.0.181-oracle
sdk default java 11.0.0-open