The question is possible duplicated from How to install Java 8 on Mac, however, it's not clear how to install the same package without sudo.
There is special option for brew
to install in specific location --appdir=~/Applications
. However, setting this doesn't work neither with brew cask install --appdir=~/Applications <java 8 package>
, nor via export HOMEBREW_CASK_OPTS="--appdir=~/Applications"
.
Thanks.