The older Oracle JDKs are gone from Homebrew now. Use OpenJDK instead:
brew tap adoptopenjdk/openjdk
brew cask install adoptopenjdk8
OpenJDK is a drop-in replacement for the Oracle JDK in most places, so this should work fine for you with no code or build process changes.