if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?
What you were trying to do (and why)
Install sbt and use my existing Java installation.
What happened (include command output)
sbt is running with JDK 13.0.2.
$ sbt 'eval sys.props("java.version")'
[warn] No sbt.version set in project/build.properties, base directory: /private/tmp/foo
[info] Loading settings for project global-plugins from idea.sbt,vimquit.sbt,plugins.sbt,pgp.sbt ...
[info] Loading global plugins from /Users/eed3si9n/.sbt/1.0/plugins
[info] Set current project to foo (in build file:/private/tmp/foo/)
[info] ans: String = 13.0.2
The reason this is problematic for sbt is because it is a build tool, used to to build libraries and applications on JVM. Changing the JVM version suddenly is a breaking change itself, but the even bigger issue is that the JVM version has a transitive property ("contagious"). Once a library is published with JDK 13, then the consumer has to use JDK 13 too.
For tooling and library authors, this usually means sticking to the lowest stable JDK version. Even for application authors, upgrading from one JDK version to another is a decision we don't make lightly. Certainly not by brew upgrade accidents.
Homebrew will use brewed dependencies where possible. The fact that other Java versions were previously possible was an unfortunate side-effect of java not being built from source as a formula. The current situation is the intended usage within Homebrew. If people want to use a different dependency the best course of action is to maintain it in a tap, which is very easy to do: https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap.
Just a couple of points to highlight:
The openjdk installed as a dependency is not symlinked anywhere and will be used only if JAVA_HOME is not set
If you'd like to use another Java installation feel free to set JAVA_HOME to any Java you want
Using some random/installed by default Java is not reliable for software shipping.