I am trying to run a scala program, in which there are errors with Java 16. My colleague is using Java 15, and all is fine. When i type java -version
in my terminal it says i am using Java 15. However, when i run sbt run -v
, it says it is using Java 16, and thus the program throws errors.
I am seeing people talk about this sbt-extra
thing, but not a whole lot of explanation on how to use it. I do not even have Java 16 installed on my Mac, so I am really confused as to why SBT says this.
JAVA_HOME
If you are sure you do not have Java 16 installed then it shouldn't use that, sbt doesn't download JDKs. – Andererwhich java
. You can setJAVA_HOME
or usesbt -java-home <path/to/jdk>
to use specific jdk. – Winery